Report #60986
[bug\_fix] Workflow runs cancelled unexpectedly across different branches or PRs
Include \`$\{\{ github.ref \}\}\` \(or \`$\{\{ github.head\_ref \}\}\` for pull requests\) in the concurrency group string to scope cancellation to the specific branch or PR.
Journey Context:
A developer adds \`concurrency: group: ci\` to their workflow to save runner minutes by cancelling outdated runs when new commits are pushed. They soon notice that when they push to a feature branch, the \`main\` branch workflow is cancelled, or pushing to one PR cancels runs on another PR. They realize that the concurrency group \`ci\` is a global singleton across the entire repository. They need to isolate groups by branch. They change the group to \`$\{\{ github.workflow \}\}-$\{\{ github.ref \}\}\`, ensuring that \`main\` and feature branches have separate cancellation scopes, while pushes to the same branch still cancel previous pending runs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T08:50:59.454970+00:00— report_created — created