⚡ Cancel stale CI runs per PR to free the self-hosted runner#32
Closed
AhtishamShahid wants to merge 2 commits into
Closed
⚡ Cancel stale CI runs per PR to free the self-hosted runner#32AhtishamShahid wants to merge 2 commits into
AhtishamShahid wants to merge 2 commits into
Conversation
With a single self-hosted runner (penpot-runner-02) serving all jobs, queued runs from an earlier push can block the runner for the full 24-hour workflow timeout — causing downstream jobs that need build-integration to be skipped. Adding a per-ref concurrency group ensures any in-progress run is cancelled when a new push arrives, keeping the runner free for the latest commit.
There was a problem hiding this comment.
Pull request overview
This PR aims to cancel stale GitHub Actions runs per PR to free the single self-hosted runner by introducing workflow-level concurrency with cancel-in-progress: true.
Changes:
- Adds a top-level
concurrencyblock scoped to${{ github.workflow }}-${{ github.ref }}in the CI workflow. - (Unintended) Leaves an existing
concurrencyblock in place, resulting in twoconcurrency:keys in the same workflow file.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1
to
+5
| name: "CI" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true |
Author
|
Closing — the workflow already has a |
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.
Problem
All 11 CI jobs are pinned to a single self-hosted runner (
penpot-runner-02). When multiple jobs queue up on one runner they serialize. A run started on an earlier push can occupy the runner for the full 24-hour workflow timeout — causing jobs withneeds: build-integration(the Integration Tests) to be skipped becauseBuild Integration Bundlenever completes in time.Fix
Add a workflow-level
concurrencygroup scoped togithub.ref:This is per-PR — each PR's ref is unique (
refs/pull/N/merge), so cancelling a stale run on PR #24 has no effect on PR #25.Effect
When you push a new commit to a PR, any in-progress CI run for that PR is cancelled immediately, freeing the runner for the latest commit rather than waiting out the 24-hour timeout.