fix(ci): stop cancelling main branch CI runs on concurrent pushes#392
Merged
Conversation
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>
Deploying archgate-cli with
|
| 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 |
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>
Contributor
Code Coverage
Full HTML report available in workflow artifacts. Per-directory breakdown
|
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>
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.
Summary
mainno longer cancel each other's CI runsgithub.sha(unique per push) instead ofgithub.ref(sharedrefs/heads/main) for the concurrency group key on push eventscancel-in-progresstopull_requestevents only where applicableAffected workflows and cancelled run counts:
code-pull-request.yml)github.sha+cancel-in-progressonly for PRscodeql.yml)github.sha+cancel-in-progressonly for PRsscorecard.yml)github.sha+cancel-in-progress: false(no PR trigger)dco.yml)Trigger: Run 26697525843 — the
0.42.0release validation was cancelled mid-flight when a Renovate merge (#390) landed 31 seconds later. Same push also cancelled CodeQL run 26697525829.Test plan
refs/heads/mainmainin quick succession and confirm both runs complete independently