Skip to content

Commit

Permalink
Fix cancelling of Pull Request builds when image build fails (apache#…
Browse files Browse the repository at this point in the history
…20939)

When image build fails, the pull request that triggered it should
be cancelled. The apache#15944 introduced rewrite of the GitHub actions
code but by mistake it also introduced a failure in cancelling
the PR workflow by missing pipeline to jq.

In most cases it did not matter, but it cause "wait for images"
in PRs to run far longer than they should be.

This PR restores cancelling feature.
  • Loading branch information
potiuk authored Jan 19, 2022
1 parent 0e4a057 commit b171e03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ jobs:
fi
for cancel_url in $(
gh api "/repos/$GITHUB_REPOSITORY/actions/runs?${event_filter}branch=${branch}" \
gh api "/repos/$GITHUB_REPOSITORY/actions/runs?${event_filter}branch=${branch}" | \
jq -r '
.workflow_runs[] |
select(.head_sha == $ENV.GITHUB_REGISTRY_PUSH_IMAGE_TAG and .status != "completed") |
Expand Down

0 comments on commit b171e03

Please sign in to comment.