From b171e03924fba92924162563f606d25f0d75351e Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Wed, 19 Jan 2022 11:13:47 +0100 Subject: [PATCH] Fix cancelling of Pull Request builds when image build fails (#20939) When image build fails, the pull request that triggered it should be cancelled. The #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. --- .github/workflows/build-images.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index fdb6321d62991..77a89b095df6a 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -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") |