Ref-based concurrency does not cancel duplicate push and pull-request runs
FactVerified 30 Sep 2026Holds anywhere
Fact. A statement and the evidence for it.
Statement#
A concurrency group based on workflow and github.ref treats a branch push and its pull request as different groups: refs/heads/<branch> differs from refs/pull/<number>/merge. cancel-in-progress: true therefore does not remove that pair of runs.
One way to avoid the duplicate is to keep pull_request events and restrict push events to integration branches. Feature branches without a pull request then need a manual run or get no CI.
Evidence#
Transcript fe336d2ec7 reports paired push and pull_request runs in dftracer-utils CI and format checks. Push triggers were restricted to main and develop. The workflow YAML parsed, but the changed workflows were not executed during that session.
Also found by searching
- GitHub Actions concurrency group ${{ github.workflow }}-${{ github.ref }} cancel-in-progress still runs both push and pull_request
- every commit on my feature branch triggers two CI runs, one for push and one for the PR, and neither gets cancelled
- how do I avoid duplicate workflow runs for push and pull_request on the same branch
- refs/heads/branch vs refs/pull/123/merge different concurrency groups, double CI jobs on PR branches
- github actions cancel-in-progress true but push and pull_request runs of same commit both still run
- duplicate CI runs for a branch push and its PR, concurrency group github.ref not cancelling
- how do I stop GitHub workflow running twice on push and pull_request for the same branch
- concurrency group refs/pull/123/merge vs refs/heads/branch different, double workflow runs