Repository navigation
ci: key PR concurrency groups by PR number, not ref - #82
Conversation
A merged PR's pull_request events (release-please's 'autorelease: tagged' relabel, the closed trigger) carry the base branch as github.ref, so a github.ref-keyed group with cancel-in-progress puts them in main's group and cancels the in-flight push-to-main run. Key PR runs by PR number, falling back to github.ref for push events. Task: W1-S3-FIX-CONCURRENCY
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
gusfcarvalho
left a comment
There was a problem hiding this comment.
Reviewed: LGTM. Fixes the push-to-main CI cancellations on this repo (21:36, 21:24 and 14:28 on 2026-10-08). Events on a merged PR, like release-please's relabel, carry github.ref=refs/heads/main, so they shared main's ci group and cancelled its run. Keying the group by PR number keeps them apart, and cancel-in-progress is unchanged. The README preview snippet now matches the fix already merged on the 7 mock preview callers. ci / required is green on 8d4ee0f, and the ci: type means no release is needed.
When release-please merges its PR it relabels it (
autorelease: tagged). Thatlabeledevent firespull_requestworkflows, and for a closed/merged PR GitHub setsgithub.refto the base branch (refs/heads/main), notrefs/pull/N/merge. Agithub.ref-keyed group withcancel-in-progressthen cancels the in-flight push-to-main run: this repo's ownci(push-to-main runs cancelled 2026-10-08 at 14:28, 21:24 and 21:36), and the documentedpreview.ymlcaller (mock-plugin-1 run 37850525371: "higher priority waiting request for preview-refs/heads/main").Fix: key PR runs by PR number, keep the ref for push events:
group: <name>-${{ github.event.pull_request.number || github.ref }}.cancel-in-progressis unchanged..github/workflows/ci.yml:ci-${{ github.event.pull_request.number || github.ref }}.README.md: preview caller snippet now usespreview-${{ github.event.pull_request.number || github.ref }}, with a one-line comment on why.A repo-wide grep (README, docs/, .github/) found no other
github.ref-keyed concurrency group; the rest use fixed names orgithub.repository.No reusable workflow changes, so
ci:and no release. Consuming repos'preview.ymlcallers need the same one-line change separately.Checks: actionlint v1.7.12,
go test -race ./...,go vet ./...,gofmt -l .,go run ./cmd/manifeston both manifests.Task: W1-S3-FIX-CONCURRENCY (local-dev/docs/release-automation/workstream-1-foundations.md)
🤖 Generated with Claude Code