Skip to content

ci: cancel superseded pull-request runs - #26

Merged
epodivilov merged 1 commit into
mainfrom
ci/concurrency-group
Jul 22, 2026
Merged

ci: cancel superseded pull-request runs#26
epodivilov merged 1 commit into
mainfrom
ci/concurrency-group

Conversation

@epodivilov

Copy link
Copy Markdown
Owner

Adds a concurrency block to ci.yml, keyed on ${{ github.workflow }}-${{ github.ref }}.

cancel-in-progress is an expression rather than a bare true:

  • On pull_request, a series of pushes to an open PR currently starts parallel runs, and the superseded ones grind to completion. Their result is already obsolete, so finishing them only pushes the green check later. Cancelling them shortens feedback time.
  • On push: main, cancellation is not wanted. Aborting a run halfway would leave the branch without a verified state.

release.yml is deliberately left alone: it is workflow_dispatch-triggered, and a cancellation between the tag push and the GitHub Release creation would leave a half-published release.

The workflow was parsed with PyYAML and with the yaml CLI in strict mode before committing.

@epodivilov
epodivilov marked this pull request as ready for review July 21, 2026 22:04
Add a concurrency group keyed on workflow and ref. Cancellation is
enabled only for pull_request events, where a new push makes the
in-flight run's result obsolete and waiting for it just delays the
check. Runs on push to main are never cancelled, so the branch always
ends up with a fully verified state.
@epodivilov
epodivilov force-pushed the ci/concurrency-group branch from 60bf859 to fbc4924 Compare July 21, 2026 22:07
@epodivilov
epodivilov merged commit 1eff3c8 into main Jul 22, 2026
1 check passed
@epodivilov
epodivilov deleted the ci/concurrency-group branch July 22, 2026 07:17
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