Skip to content

Commit

Permalink
Make concurrency group in CI less specific
Browse files Browse the repository at this point in the history
Since 93f4cfc 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.
  • Loading branch information
nineinchnick authored and martint committed Dec 19, 2022
1 parent c18e2cc commit 0d73d10
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0d73d10

Please sign in to comment.