mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
check_github_status.sh can check for user defined statuses
You can call it like this:
./script/ci/check_github_status.sh "pending|success"
It will check if the status is pending or success.
This commit is contained in:
@@ -15,5 +15,11 @@ echo "--- Checking environment variables"
|
||||
require_env_vars OFN_COMMIT BUILDKITE_REPO
|
||||
|
||||
echo "--- Checking GitHub status"
|
||||
if [ -n "$1" ]; then
|
||||
REQUIRED_STATUS="$1"
|
||||
else
|
||||
REQUIRED_STATUS="success"
|
||||
fi
|
||||
echo "Require status '$REQUIRED_STATUS'"
|
||||
echo "Visiting $GITHUB_API_URL"
|
||||
curl -s "$GITHUB_API_URL" | head -n 2 | grep '^ *"state": "success",$'
|
||||
curl -s "$GITHUB_API_URL" | head -n 2 | grep '^ *"state":' | egrep "\"$REQUIRED_STATUS\",\$"
|
||||
|
||||
Reference in New Issue
Block a user