Skip to content

Commit 3dac4fd

Browse files
tarebyteclaude
andcommitted
Cancel stale CI runs on new pushes
Group by workflow + ref so main and each PR branch have independent queues. A new push to a branch cancels the previous in-progress run on that same branch, keeping concurrent runs on unrelated branches untouched. Saves runner minutes on rebases and force-pushes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8d36bd1 commit 3dac4fd

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ on:
33
push:
44
branches: [main]
55
pull_request:
6+
# Cancel any in-progress run on the same ref when a new commit lands.
7+
# Groups by workflow + ref so main and each PR branch have independent
8+
# queues — a new push to PR #42 cancels the old PR #42 run but leaves
9+
# a concurrent main run alone.
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
613
jobs:
714
test:
815
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)