Skip to content

Commit a653cc2

Browse files
committed
fix(ci): never supersede release-relevant CI runs so release PRs stay green
Give pushes to master/main/next/hotfixes and the next/hotfixes → master/main release PRs a UNIQUE concurrency group per run (run_id appended) instead of a per-ref group with cancel-in-progress. During the burst of pushes a release makes to next/hotfixes (the feature squash, the post-hotfix master→next sync merge, the bot's `chore: bump version`), the earlier run was cancelled into a red X on the release PR; each now runs to completion and posts a green check. Feature branches / feature PRs keep cancel-in-progress. A bare `cancel-in-progress: false` wouldn't suffice — GitHub still cancels the middle PENDING run when a newer one queues; a unique-per-run group avoids all of it. Mirrors the CLDMV/.github core-cicd `ci.yml` template change.
1 parent ca8d509 commit a653cc2

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,23 @@ on:
131131
required: false
132132
default: true
133133

134-
# Cancel superseded runs on feature branches; keep every master/main run as the
135-
# permanent green record. Keyed on github.ref so push and pull_request events
136-
# for the same branch share a group (the `if:` on the ci job already prevents
137-
# non-fork PR sync from running, but the shared group guards against edge
138-
# cases).
134+
# Concurrency policy, by context:
135+
# - FEATURE branches / feature PRs → cancel superseded runs (per-ref group +
136+
# cancel-in-progress): a newer push makes the older run redundant.
137+
# - RELEASE-relevant contexts → NEVER superseded. Pushes to
138+
# master/main/next/hotfixes and the next/hotfixes → master/main release PRs
139+
# each get a UNIQUE group per run (run_id appended), so nothing cancels them.
140+
# During the burst of pushes a release makes to next/hotfixes (the feature
141+
# squash, the post-hotfix master→next sync merge, the bot's `chore: bump
142+
# version`), every run completes and posts a GREEN check instead of the
143+
# earlier one being cancelled into a red X on the release PR. A bare
144+
# `cancel-in-progress: false` is NOT enough — GitHub still cancels the middle
145+
# PENDING run when a newer one queues; a unique group avoids all of it.
146+
# github.head_ref is set only on pull_request (the PR's head → next/hotfixes for
147+
# release PRs); github.ref carries the branch on push.
139148
concurrency:
140-
group: ci-${{ github.workflow }}-${{ github.ref }}
141-
cancel-in-progress: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }}
149+
group: ci-${{ github.workflow }}-${{ github.ref }}${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next' || github.ref == 'refs/heads/hotfixes' || github.head_ref == 'next' || github.head_ref == 'hotfixes') && format('-{0}', github.run_id) || '' }}
150+
cancel-in-progress: true
142151

143152
# Workflow-level: matches the broadest write surface the called
144153
# `workflow-ci.yml` reaches across its branches:

0 commit comments

Comments
 (0)