Skip to content

Commit b23a5ad

Browse files
committed
Auto merge of #113059 - Kobzol:ci-concurrency-fix, r=pietroalbini
CI: do not cancel concurrent builds on the same branch Do not cancel concurrent builds on the same branch (outside of PRs). Instead, only cancel them if the builds have the same commit SHA. From the [documentation](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context): > The commit SHA that triggered the workflow. The value of this commit SHA depends on the event that triggered the workflow. For more information, see "[Events that trigger workflows](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows)." For example, ffac537e6cbbf934b08745a378932722df287a53. Fixes: #112955 (comment) r? `@pietroalbini`
2 parents a20a04e + 32428ab commit b23a5ad

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ defaults:
3131
run:
3232
shell: bash
3333
concurrency:
34-
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
34+
group: "${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.sha) || github.ref }}"
3535
cancel-in-progress: true
3636
jobs:
3737
pr:

src/ci/github-actions/ci.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,10 @@ defaults:
299299
shell: bash
300300

301301
concurrency:
302-
# For a given workflow, if we push to the same PR, cancel all previous builds on that PR.
303-
# If the push is not attached to a PR, we will cancel all builds related to the same commit SHA.
304-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
302+
# For a given workflow, if we push to the same branch, cancel all previous builds on that branch.
303+
# We add an exception for try builds (try branch) and unrolled rollup builds (try-perf), which
304+
# are all triggered on the same branch, but which should be able to run concurrently.
305+
group: ${{ ((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.sha) || github.ref }}
305306
cancel-in-progress: true
306307

307308
jobs:

0 commit comments

Comments
 (0)