diff --git a/calculate-buildkite-steps.py b/calculate-buildkite-steps.py index 2b931c59c..ebe712ade 100755 --- a/calculate-buildkite-steps.py +++ b/calculate-buildkite-steps.py @@ -139,7 +139,7 @@ try: # failed (but not retried). # # This information is checked by querying the Buildkite REST API - # and counting all `failed` or `canceled` steps. + # and counting all non-`passed` steps. # # This step must be :ice_cream: (yes, really!) because the post-command # hook will inspect this name. @@ -155,7 +155,7 @@ try: readonly FAILED_JOBS=$(curl --silent \ -H "Authorization: Bearer $(buildkite-agent secret get build_status_token)" \ "https://api.buildkite.com/v2/organizations/$${BUILDKITE_ORGANIZATION_SLUG}/pipelines/$${BUILDKITE_PIPELINE_SLUG}/builds/$${BUILDKITE_BUILD_NUMBER}" \ - | jq '.jobs | map(select(.state == "failed" or .state == "canceled")) | length') + | jq '.jobs | map(select(has("state") and .state != "passed" and .name != ":ice_cream:")) | length') echo "$$FAILED_JOBS build jobs failed." (( $$FAILED_JOBS == 0 ))