Never cancel a main or tag run (CI remediation) #5
Loading…
Reference in a new issue
No description provided.
Delete branch "ci-concurrency-never-cancel-main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stephen's CI remediation mission, Apple audit #3 and #7 (M2). The workflow's concurrency group was keyed on the ref with cancel-in-progress always on, so a second push to main cancelled the first merge's run (Forgejo records a cancelled job as a failure) and a re-pushed tag cancelled its predecessor.
Now only a pull_request run is cancelled by a newer push to the same PR branch. Outside pull_request the group is the event, the ref and the SHA, so each main push and each tag keeps a group of its own and is neither cancelled nor replaced while queued. fjord-ios's ci.yml already uses this shape (its group is keyed on the event and the head ref or SHA).
Not changed: the jobs, branch protection (this repo has none; that is a separate audit item), and fork-PR grouping (two forks with the same branch name would share a group; the repo is private and has no fork PRs).
Automated Codex review (read-only) of head
fa5dc937e8.Low (edge case),
.forgejo/workflows/ci.yml:19: The invariant is that every main or tag run retains its own concurrency group. A tag deleted and recreated at the same commit produces the same ref and SHA, so multiple queued runs can still share a group and a newer pending run can replace an older one. The same applies if main returns to a previously pushed commit. Include a unique run identifier in the non-PR group.Low (edge case),
.forgejo/workflows/ci.yml:19: The invariant is that only runs for the same PR supersede one another. As acknowledged in the PR body, PRs from two forks with the same branch name sharegithub.head_refand can cancel one another. Key PR groups by PR number or by source repository and branch. The body states that this private repository has no fork PRs.BLOCKING: 0
Reviewed head
fa5dc937e8at 2026-11-22T20:04:46Z by codex exec (read-only sandbox).