Skip to content

Commit e1437d4

Browse files
authored
chore: don't cancel concurrent main builds (#342)
Fixing this in all our rulesets. This updates the GHA ci.yaml `concurrency` block to match all of our other rule sets. In particular, the `cancel-in-progress` is updated to _not_ cancel in progress main builds `${{ github.ref_name != 'main' }}` so that if two commits land on main back-to-back the 2nd one does not cancel the first if it is still running CI.
1 parent 5481e10 commit e1437d4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ on:
1212
workflow_dispatch:
1313

1414
concurrency:
15-
# Cancel previous actions from the same PR: https://stackoverflow.com/a/72408109
16-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17-
cancel-in-progress: true
15+
# Cancel previous actions from the same PR or branch except 'main' branch.
16+
# See https://docs.github.com/en/actions/using-jobs/using-concurrency and https://docs.github.com/en/actions/learn-github-actions/contexts for more info.
17+
group: concurrency-group::${{ github.workflow }}::${{ github.event.pull_request.number > 0 && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}${{ github.ref_name == 'main' && format('::{0}', github.run_id) || ''}}
18+
cancel-in-progress: ${{ github.ref_name != 'main' }}
1819

1920
jobs:
2021
test:

0 commit comments

Comments
 (0)