Repository navigation
fix(ci): a skipped draft run can no longer cancel or mask the real run - #9
Merged
Merged
Conversation
A force-push to a draft PR followed by "ready for review" a second later started two runs in one concurrency group; when the draft run arrived last it cancelled the real run, and its skipped ci-ok then counted as the passing required check for the head SHA. Draft and real runs now use separate concurrency groups, only PR runs cancel superseded runs, and jobs in draft runs are renamed "<job> (draft, not run)" so they never report as ci-ok. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…revious head When a push and "ready for review" land together, GitHub can attach the ready_for_review run to the old head, leaving the new SHA with only the skipped draft run and no ci-ok. A small draft job now checks the live PR state: if the PR is ready and no other CI run covers this SHA, the run does the real checks. ci-ok always runs and reports as "ci (draft, not run)" in runs that stayed drafts, which also replaces the job renames whose expressions showed raw on skipped jobs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jayleaton
marked this pull request as ready for review
October 22, 2026 07:40
Opening a draft PR and marking it ready seconds later let the draft run check before GitHub had created the ready run, so both ran the full checks. Waiting 15 s (only when the PR is already ready) avoids the duplicate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 22, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A force-push to a draft PR and
gh pr readyabout a second apart start two runs in the same concurrency group (ci-<workflow>-<ref>, cancel-in-progress). When the draft run (every job skipped) is queued last, it cancels the real run. Its skippedci-okthen becomes the latest check on the head SHA, and GitHub counts a skipped required check as passing. So the head can look green although nothing ran.A second failure mode in the same scenario: when the push and the ready event land together, GitHub can attach the
ready_for_reviewrun to the previous head, leaving the new SHA with only the draft run and noci-okat all.How
ci-okalways runs, so a skipped job never shows its raw name expression. In a run that stays a draft it is namedci (draft, not run), so it can never satisfy the requiredci-okcheck.go,changesandmobilejobs keep static names.Evidence
Scratch PR #5 (now closed, branch deleted): force-push, then
gh pr ready0–1 s later.Before (main's workflow), at gap 0.5 s: real run 39739182843 ended with
changes=cancelled go=cancelled ci-ok=failure. The head's checks then showed only the draft run's skippedci-ok. In other attempts, the draft run cancelled itself or the real run won.After (this branch):
ci (draft, not run))PR #5 ready-now run=trueand ranchangesandgofor real;ci-okpassed.ci (draft, not run), and noci-okon the SHA.ci-ok; the new SHA is green.ready-now run=false, and only one full run happened.actionlintis clean andmake cipasses. CI on this PR's head is green: one run, 1m25s.Merge Danger
Door: two-way. This only changes the workflow file.
Blast Radius: CI. Draft pushes now start two tiny jobs (
draft,ci (draft, not run), about 4 s each) instead of zero. Thedraftjob waits an extra 15 s when the PR is already ready at check time. Pushes to main and merge-queue runs are no longer cancelled by later ones.🤖 Generated with Claude Code