From 10767ae29dfd6daf3b8ef9a5847f399eb9fe2f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Wa=C5=9B?= Date: Sun, 18 Dec 2022 18:17:18 +0100 Subject: [PATCH] Make concurrency group in CI less specific Since 93f4cfc429677c1b8ef18fcadb4a89c3c663f4b7 the concurrency group also handles repository dispatch events, but it incorrectly includes the SHA, making it too specific. SHA should only be used for events other than pull requests or repository dispatch. --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 008de783f436..228bdce5807f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,11 @@ concurrency: # Cancel all workflow runs except latest within a concurrency group. This is achieved by defining a concurrency group for the PR. # Non-PR builds have singleton concurrency groups. # When triggered by the repository_dispatch, add the expected SHA to avoid cancelling the run from the PR. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.sha }}-${{ github.event_name == 'repository_dispatch' && github.event.client_payload.slash_command.args.named.sha || github.sha }} + group: | + workflow=${{ github.workflow }}, + pr_number=${{ github.event_name == 'pull_request' && github.event.number || 'NA' }}, + dispatch_sha=${{ github.event_name == 'repository_dispatch' && github.event.client_payload.slash_command.args.named.sha || 'NA' }}, + commit_sha=${{ github.event_name != 'pull_request' && github.event_name != 'repository_dispatch' && github.sha || 'NA' }} cancel-in-progress: true jobs: