ci: dedupe concurrent CI runs on identical commit (push + pull_request)#323
Merged
Conversation
develop and main are both push- and pull_request-trigger branches; a commit landing on develop while a develop->main release PR is open fires both events for the same SHA (surfaced by PR #320, where the push- triggered run hit a transient apt.llvm.org outage independently of the pull_request-triggered run that had already passed). Add a workflow-level concurrency group keyed on the actual commit SHA (pull_request head SHA, else push SHA) with cancel-in-progress so the redundant run is cancelled instead of wasting CI minutes and doubling exposure to flaky externals.
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
develop/mainare bothpush- andpull_request-trigger branches, so a commit landing ondevelopwhile adevelop→mainrelease PR is open fires CI twice for the identical SHA (once viapush, once viapull_request: synchronize).push-triggered run'sc-format-checkhit a transientapt.llvm.orgoutage independently of thepull_request-triggered run of the same commit, which had already passed — pure wasted duplicate work, and doubled exposure to that kind of external flake.concurrencygroup keyed on the actual commit SHA (github.event.pull_request.head.shawhen present, elsegithub.sha) withcancel-in-progress: true, so the redundant run is cancelled rather than both running to completion. Does not touch thepushtrigger itself — post-merge verification ondevelop/mainwhen no PR is open is unaffected, since that scenario never produces a concurrent duplicate.Test plan
.github/workflows/ci.ymlvalidated as well-formed YAMLdevelopwhile adevelop→mainPR is open: expect only one of the two triggered runs to complete, the other showingcancelled