Skip to content

Commit 062e66f

Browse files
ci: supersede in-flight PR runs on a new push
NativePipeline already had concurrency + cancel-in-progress, but Build, UnitTests, Release and ShaCheck had none — so every push to a PR left the previous run of each still going. On GitHub Free all of them share one 20-concurrent-job cap with NativePipeline's ~10 test shards, so stale runs were not just noise: they delayed the run for the commit under review. cancel-in-progress is gated on pull_request. A push run on main / mx-* is the recorded CI result for that commit (and Release.yml's push path publishes), so those are allowed to finish; only superseded PR runs get cancelled. Not added to MarketplaceRelease.yml (tag-triggered publish — never cancel), NightlyDispatcher.yml (scheduled), the workflow_dispatch-only workflows, or PullRequestLabeler.yml (seconds long). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent a0ffc7b commit 062e66f

4 files changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/Build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ on:
99
branches:
1010
- main
1111
- 'mx/**'
12+
13+
# Supersede in-flight runs: a new push to the same PR/branch cancels the previous run
14+
# instead of queueing beside it (this repo shares GitHub Free's 20-concurrent-job cap with
15+
# NativePipeline, so stale runs directly delay the ones that matter). Only PR runs are
16+
# cancelled — a push run on main/mx-* is the recorded result for that commit, so let it finish.
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
20+
1221
jobs:
1322
test:
1423
name: "Build (${{ matrix.os }})"

.github/workflows/Release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ on:
66
pull_request:
77
branches: [main, 'mx/11.12.x']
88

9+
# Supersede in-flight runs: a new push to the same PR/branch cancels the previous run
10+
# instead of queueing beside it (this repo shares GitHub Free's 20-concurrent-job cap with
11+
# NativePipeline, so stale runs directly delay the ones that matter). Only PR runs are
12+
# cancelled — a push run on main/mx-* is the recorded result for that commit, so let it finish.
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
16+
917
jobs:
1018
test:
1119
name: "Release (${{ matrix.os }})"

.github/workflows/ShaCheck.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ on:
1010
paths:
1111
- ".github/workflows/*.yml"
1212

13+
# Supersede in-flight runs: a new push to the same PR/branch cancels the previous run
14+
# instead of queueing beside it (this repo shares GitHub Free's 20-concurrent-job cap with
15+
# NativePipeline, so stale runs directly delay the ones that matter). Only PR runs are
16+
# cancelled — a push run on main/mx-* is the recorded result for that commit, so let it finish.
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
20+
1321
jobs:
1422
harden_security:
1523
name: Check SHA in GH Actions

.github/workflows/UnitTests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ on:
66
pull_request:
77
branches: [main, 'mx/11.12.x']
88

9+
# Supersede in-flight runs: a new push to the same PR/branch cancels the previous run
10+
# instead of queueing beside it (this repo shares GitHub Free's 20-concurrent-job cap with
11+
# NativePipeline, so stale runs directly delay the ones that matter). Only PR runs are
12+
# cancelled — a push run on main/mx-* is the recorded result for that commit, so let it finish.
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
16+
917
jobs:
1018
test:
1119
name: "Unit tests"

0 commit comments

Comments
 (0)