Skip to content

Commit 7cab4b7

Browse files
authored
ci: fix concurrency group causing master badge to show cancelled
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).
1 parent ff0a938 commit 7cab4b7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
pull_request:
99

1010
concurrency:
11-
group: test-${{ github.head_ref }}
11+
group: test-${{ github.head_ref || github.ref }}
1212
cancel-in-progress: true
1313

1414
env:

0 commit comments

Comments
 (0)