ci: fix concurrency group causing master badge to show cancelled#595
Merged
utensil merged 1 commit intopygae:masterfrom Apr 4, 2026
Merged
Conversation
github.head_ref is only set for pull_request events; it is empty for push-to-master and tag events. When two push events land in quick succession (e.g. merge commit + release tag), both go into the same unnamed group 'test-' and the second cancels the first, causing the master badge to show 'cancelled'. Using `github.head_ref || github.ref` gives each branch/tag its own concurrency group while keeping the cancel-in-progress behaviour for PRs (where head_ref is 'refs/pull/NNN/merge', unique per PR).
Member
|
Thanks! |
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
github.head_refis only populated forpull_requestevents — it is empty forpush(branch or tag) events. When two push events occur in quick succession (e.g. a merge commit to master followed immediately by a release tag), both land in the same concurrency grouptest-and the second run cancels the first.This is what happened after #594 merged and the
v0.6.1rc1tag was created 7 seconds later: the tag run cancelled the master run, leaving the master branch badge showingcancelledeven though all checks actually passed.Fix
github.head_ref || github.refgives each branch/tag its own concurrency group:github.head_ref= the PR's head branch name (unique per PR) — cancel-in-progress still worksgithub.ref=refs/heads/mastergithub.ref=refs/tags/v0.6.1rc1No more cross-event cancellations.
References
Discovered during the 0.6.1rc1 release (see #588).