Skip to content

fix(ci): stop cancelling main branch CI runs on concurrent pushes#392

Merged
rhuanbarreto merged 3 commits into
mainfrom
fix/ci-no-cancel-main-pushes
May 30, 2026
Merged

fix(ci): stop cancelling main branch CI runs on concurrent pushes#392
rhuanbarreto merged 3 commits into
mainfrom
fix/ci-no-cancel-main-pushes

Conversation

@rhuanbarreto

@rhuanbarreto rhuanbarreto commented May 30, 2026

Copy link
Copy Markdown
Contributor

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 — 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.

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

The concurrency group used `github.ref` for push events, so all main
branch runs shared the same group (`Validate-refs/heads/main`). With
`cancel-in-progress: true`, a second merge landing before the first
run finished would cancel it — observed in run 26697525843 where the
release 0.42.0 validation was killed by a Renovate merge 31s later.

Fix: use `github.sha` instead of `github.ref` so each push to main
gets its own concurrency group, and restrict `cancel-in-progress` to
pull_request events only (where superseding old runs is desired).

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 30, 2026

Copy link
Copy Markdown

Deploying archgate-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 84ea169
Status: ✅  Deploy successful!
Preview URL: https://9f074bad.archgate-cli.pages.dev
Branch Preview URL: https://fix-ci-no-cancel-main-pushes.archgate-cli.pages.dev

View logs

Both workflows had the same cancel-in-progress bug on main branch
pushes. CodeQL had 4 cancelled runs, Scorecard had 2.

CodeQL: use github.sha + restrict cancel-in-progress to PRs (same
pattern as Validate workflow).

Scorecard: uses github.sha and disables cancel-in-progress entirely
since it only triggers on push/schedule (no PR trigger).

DCO is PR-only so cancel-in-progress is correct there — no change.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
@github-actions

github-actions Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Code Coverage

Metric Value
Lines 90.3% (6735 / 7458)
Threshold 90% minimum — met
Platforms Linux + Windows

Full HTML report available in workflow artifacts.

Per-directory breakdown
Directory Coverage Lines
src/commands/ 88.0% 2082 / 2365
src/engine/ 93.1% 1379 / 1481
src/formats/ 100.0% 141 / 141
src/helpers/ 90.3% 3133 / 3471

The release job ran `git pull --rebase origin main` before calling
simple-release-action. If any commit landed on main between the
release merge and the job reaching that step, HEAD moved past the
release commit. simple-release-action then checked HEAD, saw a
non-release commit, and silently skipped the release (exit 0).

This is what prevented v0.42.0 from being tagged: the Renovate npm
update merged 31s after the release, so `git pull` fast-forwarded
HEAD to that commit and the release action said "Condition failed."

Removing the step makes the job idempotent — the checkout already
has the release commit (the SHA that triggered the push event), and
the tag should point at that commit, not at tip-of-main.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
@rhuanbarreto rhuanbarreto merged commit 9edabde into main May 30, 2026
23 checks passed
@rhuanbarreto rhuanbarreto deleted the fix/ci-no-cancel-main-pushes branch May 30, 2026 23:45
@archgatebot archgatebot Bot mentioned this pull request May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant