From 1c46b8dccb60be4df201ecd7d2af8d0501ada68d Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 20 Jan 2016 14:58:21 +1100 Subject: [PATCH] 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. --- script/ci/check_github_status.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/script/ci/check_github_status.sh b/script/ci/check_github_status.sh index c4ce47c6fa..0a4775d268 100755 --- a/script/ci/check_github_status.sh +++ b/script/ci/check_github_status.sh @@ -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\",\$"