Skip to content

Fix workflow concurrency: scope cancellation to individual PRs, never cancel main - #78

Merged
mattleibow merged 2 commits into
mainfrom
copilot/cancel-workflows-on-new-commit
Feb 18, 2026
Merged

mattleibow merged 2 commits into
mainfrom
copilot/cancel-workflows-on-new-commit

Conversation

Copilot AI commented Feb 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflows were cancelling runs across unrelated PRs and cancelling main branch builds. The run.yml concurrency group used github.ref (too broad), and test.yml/build-publish.yml had no concurrency controls.

Changes

All three workflows now use:

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

Group scoping:

  • github.workflow - isolates each workflow's concurrency
  • github.head_ref - groups PR runs by branch (only set for PRs)
  • github.run_id - fallback for main/release (unique per run)

Cancellation:

  • true for PR events → new commit cancels that PR's pending runs
  • false for push/release → main builds always complete

Effect

  • PR #123 commits cancel only PR #123 workflows
  • PR #123 and PR #124 workflows are independent
  • Main branch builds never cancel each other

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: mattleibow <1096616+mattleibow@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix workflow cancellation issues for new commits in pull requests Fix workflow concurrency: scope cancellation to individual PRs, never cancel main Feb 18, 2026
Copilot AI requested a review from mattleibow February 18, 2026 20:17
@mattleibow
mattleibow marked this pull request as ready for review February 18, 2026 20:26
@mattleibow
mattleibow merged commit 83e27a2 into main Feb 18, 2026
4 checks passed
@mattleibow
mattleibow deleted the copilot/cancel-workflows-on-new-commit branch February 18, 2026 20:26
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