ci: cancel superseded CI runs with a concurrency group#89
Merged
Conversation
The CI workflow had no concurrency control, so every push to an open PR
started a fresh ubuntu + windows matrix while the previous (now-stale) run
kept executing to completion — burning runner minutes on code that has
already been replaced.
Adds a top-level concurrency group keyed on workflow + ref:
- cancel-in-progress cancels prior in-flight runs for the same PR/branch
when new commits arrive.
- Pushes to main are exempt (cancel-in-progress evaluates to false on
refs/heads/main) so main retains complete, uninterrupted CI history.
No change to what the jobs do — purely a CI cost/latency optimization.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0167bHerb53KwtsHWVNt9qkg
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
.github/workflows/ci.ymlhas noconcurrencycontrol. As a result, every push to an open PR kicks off a fresh ubuntu + windows matrix while the previous (now-stale) run for that same branch keeps executing to completion — wasting runner minutes (and a Windows runner, billed at higher weight) on code that has already been superseded.Change
Adds a top-level concurrency group keyed on workflow + ref:
main:cancel-in-progressevaluates tofalse, so every commit landed onmainstill gets a complete, uninterrupted CI run — full history is preserved on the protected branch.This is a pure CI cost/latency optimization — it changes nothing about what the jobs run or assert.
Note
Scoped to
ci.yml(the heaviest, every-push matrix) to keep the change small and obviously correct. The same pattern could later be applied to the other matrix workflows (e.g.pip-audit.yml) if desired.🤖 Generated with Claude Code
Generated by Claude Code