ci: actually dedupe the push and pull_request runs - #19
Merged
Conversation
The concurrency group was meant to keep one run per branch, but the key did not match between the two events: github.ref is refs/heads/x on a push while github.head_ref is a bare x on a pull_request, so they landed in different groups and the full five-job matrix ran twice for every PR. ref_name is the bare branch name on a push, so both events now share a group.
A branch in this repo fires both push and pull_request, and the concurrency key did not match between them -- github.ref is refs/heads/x on a push while head_ref is a bare x -- so the full five-job matrix, including two four-minute Windows jobs, ran twice for every PR. Fixing the key alone only cancels one of the two, and a cancelled job still reports as failed, which is its own noise. Watch main directly and let pull requests cover everything else, so each change is checked exactly once.
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.
The concurrency block says it keeps one run per branch. It doesn't — the key differs between the two events:
head_refrefpushonxrefs/heads/xci-CI-refs/heads/xpull_requestfromxxrefs/pull/N/mergeci-CI-xDifferent groups, so nothing gets cancelled and the full five-job matrix runs twice for every PR — including the two ~4-minute Windows jobs.
Observed on every branch this session:
github.ref_nameis the bare branch name on a push, sogithub.head_ref || github.ref_nameputs both events in the same group and the newer run cancels the older. Roughly halves CI minutes per PR, with no change to what is actually checked.