Repository navigation
fix(ci): stop same-commit events from cancelling runs - #696
Merged
Merged
Conversation
A run cancelled by another run for the same commit before its matrix expands leaves checks under literal names (`Tests ${{ matrix.os }}`) marked failed; no later run reports under those names, so the PR stays red after a green re-run. Cancel in-progress runs only for new code (synchronize, or a push where the workflow already cancelled on push), and drop review_requested, which fired alongside opened on every PR because CODEOWNERS requests a review on open.
sini
force-pushed
the
ci/no-rerun-on-review-request
branch
from
September 24, 2026 20:38
b54e9c4 to
78561d7
Compare
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.
Summary
CI on PRs shows false reds when a run is cancelled by another run for the same commit. If the cancel lands before a job's matrix expands, GitHub records the job under its literal name (
Tests ${{ matrix.os }},Check template ${{ matrix.template }} ${{ matrix.os }}) as failed. No later run reports under those names, so the red check stays on the commit even after a green re-run. #695 shows two such checks right now.Two changes, in
test,docsandbogus:cancel-in-progressis now true only forsynchronize(a new commit on the PR), or apushin workflows that already cancelled on push. Same-commit events (labeled, approving reviews,openedracing a review request) queue behind the running build instead of killing it. If a third event arrives, GitHub cancels the older queued run, which never started and so leaves no checks.mainbuilds are still never cancelled.review_requestedfrom the triggers. CODEOWNERS requests a review when a PR opens, so every PR started two runs at once, one cancelling the other; any later review request did it again. A review request doesn't change the code.ready_for_reviewstill covers drafts, andlabeledstays soallow-cistill unlocks CI for outside contributors.On #695 the old behaviour produced three
testruns for one commit:openedTrade-off: a label or approval arriving mid-run now costs one extra full run after the current one, instead of a cancellation. Skipping re-runs when the same commit already has a passing run would remove that too, but needs more logic in
non-draft, so it isn't done here.Validation
actionlinton all three files reports the same findings asmain(12 pre-existing shellcheck notes intest.yml, none in the others).