Commit ba25815
committed
fix(ci): use head_ref in MegaLinter concurrency group to prevent self-cancellation
When a PR is merged, GitHub fires both a push event and a
pull_request[closed] event simultaneously. Since the 2023 fix to
github.ref, both events resolve to refs/heads/main, placing them in
the same concurrency group. With cancel-in-progress: true, the closed
event cancels the push run, then immediately skips (due to the
if: github.event.action != 'closed' guard), leaving no surviving
MegaLinter run.
Fix: use github.head_ref (the PR source branch) with a fallback to
github.ref (for push events). This keeps closed events in the PR's
concurrency group so they cancel in-progress PR runs as intended,
without interfering with push-triggered runs on main.1 parent db158f8 commit ba25815
1 file changed
Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 7 | + | |
12 | 8 | | |
13 | 9 | | |
14 | 10 | | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
18 | | - | |
| 14 | + | |
19 | 15 | | |
20 | 16 | | |
21 | 17 | | |
| |||
0 commit comments