Skip to content

ci: cancel previous jobs from the same branch on new push - #15

Closed
igagis-bot wants to merge 3 commits into
cppfw:mainfrom
igagis-bot:ci-cancel-previous
Closed

igagis-bot wants to merge 3 commits into
cppfw:mainfrom
igagis-bot:ci-cancel-previous

Conversation

@igagis-bot

@igagis-bot igagis-bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Add CI cancellation and tag build priority:

  • a new push to a branch or pull request cancels the previous in-flight run of the same branch/PR (concurrency group per ref, cancel-in-progress)
  • a tag build always wins over a branch build on the same commit, regardless of the order in which the runs start:
    • branch and tag runs do not share a concurrency group, so the group can never cancel a tag run (a concurrency group cancels the older run, which would not give the tag priority when the branch run starts later)
    • a new tag-priority job (all other jobs need it) cancels in-progress branch builds on the same commit in a tag build, and cancels the branch run when a tag build on the same commit is in progress

for push events, group concurrency by the pushed commit sha instead of
the ref. a tag build pushed after a branch build on the same commit
joins the same group and cancels the in-progress branch build, so only
the tag build remains.
the concurrency group cancels the older run, so it cannot give the tag
build priority when the branch run starts after the tag run. revert the
group to a plain per-ref one (branch and tag runs no longer share a
group) and add a tag-priority job that all other jobs depend on: in a
tag build it cancels in-progress branch builds on the same commit, in a
branch build it cancels the run when a tag build on the same commit is
in progress.
@igagis-bot igagis-bot closed this Nov 25, 2026
@igagis-bot
igagis-bot deleted the ci-cancel-previous branch November 25, 2026 15:08
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.

2 participants