Skip to content

Cancel superseded CI runs of a pull request - #73

Merged
zienag merged 1 commit into
yandex:mainfrom
zienag:ci-concurrency
Oct 27, 2026
Merged

zienag merged 1 commit into
yandex:mainfrom
zienag:ci-concurrency

Conversation

@zienag

@zienag zienag commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Every push to a pull request queued a new CI run while the runs for its earlier commits kept waiting for a runner and then ran to the end. With the organization's shared runners, the run for the latest commit waited behind them.

Changes

  • ci.yml puts the runs of one pull request in a concurrency group keyed by its number, with cancel-in-progress, so a new push cancels the run of the previous commit. A push to main has no pull request number, so its group is the run's own ID and runs on main are never cancelled. The workflow name in the group keeps it apart from other workflows' groups.

Test plan

  • A force-push to this PR while its first run was queued cancelled that run.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 13:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

1 open issue
What changed in this PR

Adds GitHub Actions concurrency controls to ensure newer pushes to a pull request cancel any older in-progress/queued CI runs, reducing queue backlog on shared runners.

Changes:

  • Introduces a concurrency group keyed by workflow name + PR head branch (or run ID for main pushes).
  • Enables cancel-in-progress so superseded PR runs are cancelled automatically.
File Description
.github/​workflows/​ci.yml Adds workflow-level concurrency grouping and cancellation behavior for superseded PR runs.

Review effort: Lite

Comment thread .github/workflows/ci.yml Outdated
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@zienag
zienag enabled auto-merge (squash) October 27, 2026 14:35
@zienag
zienag merged commit cfe7ad9 into yandex:main Oct 27, 2026
1 check passed
@zienag
zienag deleted the ci-concurrency branch October 27, 2026 22:40
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