Commit 9edabde
authored
fix(ci): stop cancelling main branch CI runs on concurrent pushes (#392)
## Summary
- Fix concurrency groups across **3 workflows** so pushes to `main` no
longer cancel each other's CI runs
- Use `github.sha` (unique per push) instead of `github.ref` (shared
`refs/heads/main`) for the concurrency group key on push events
- Restrict `cancel-in-progress` to `pull_request` events only where
applicable
**Affected workflows and cancelled run counts:**
| Workflow | Cancelled runs on main | Fix |
|---|---|---|
| Validate (`code-pull-request.yml`) | 10 | `github.sha` +
`cancel-in-progress` only for PRs |
| CodeQL (`codeql.yml`) | 4 | `github.sha` + `cancel-in-progress` only
for PRs |
| Scorecard (`scorecard.yml`) | 2 | `github.sha` + `cancel-in-progress:
false` (no PR trigger) |
| DCO (`dco.yml`) | 0 | No change needed (PR-only workflow) |
**Trigger:** [Run
26697525843](https://github.com/archgate/cli/actions/runs/26697525843) —
the `0.42.0` release validation was cancelled mid-flight when a Renovate
merge (`#390`) landed 31 seconds later. Same push also cancelled [CodeQL
run
26697525829](https://github.com/archgate/cli/actions/runs/26697525829).
## Test plan
- [ ] This PR's own CI run completes without being cancelled
- [ ] Verify the concurrency group in the Actions UI shows the commit
SHA, not `refs/heads/main`
- [ ] After merge, push two commits to `main` in quick succession and
confirm both runs complete independently
---------
Signed-off-by: Rhuan Barreto <rhuan@barreto.work>1 parent b5b5f94 commit 9edabde
4 files changed
Lines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
157 | | - | |
158 | 156 | | |
159 | 157 | | |
160 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
0 commit comments