@ondeinference / ed / commits / 4929c8b

Key CI concurrency on the commit rather than the ref

A merge lands the same SHA on development and then on main. Keyed on github.ref those were separate concurrency groups, so one commit started two full macOS runs of identical code. Both runs of 93be02b ended up cancelled by hand. Pull requests key on the PR number instead, because there github.sha is the ephemeral merge commit and changes with every push to the branch, which would leave superseded runs alive. Co-Authored-By: siGit Code <noreply@sigit.si>

Seto Elkahfi committed Sep 11, 2026 at 04:32 UTC 4929c8b0b3cbeb45c50c962a3e5b994199e3cfc3
1 file changed +7 -1
.github/workflows/ci.yml
+7 -1
@@ -6,7 +6,13 @@ on:
6 branches: [main, development]
7
8 concurrency:
9 - group: ci-${{ github.ref }}
9 + # Keyed on the commit, not the ref: a merge lands the same SHA on development
10 + # and then on main, and keying on the ref put those in separate groups, so one
11 + # commit paid for two full macOS runs of identical code. Pull requests key on
12 + # their number instead, because there `github.sha` is the ephemeral merge
13 + # commit and changes with every push to the branch, which would leave
14 + # superseded runs alive.
15 + group: ci-${{ github.event.pull_request.number || github.sha }}
16 cancel-in-progress: true
17
18 env: