Background
.github/workflows/docker-build.yml's concurrency: group key is:
```yaml
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.event.workflow_run.head_branch || github.ref_name }}
cancel-in-progress: true
```
For a push event, github.head_ref is empty, so the group falls back to github.ref_name (e.g. main). For a pull_request event whose head branch is main, github.head_ref is literally main. Both resolve to the identical group string (e.g. Docker Build, Publish & Test-main) whenever a PR's head branch is main or development (the case for bot-generated "propagate main→development" / weekly promotion sync PRs).
What the companion fix (this PR) does and does not solve
A companion PR adds a job-level if: skip condition to the setup job so the pull_request-triggered instance for a main/development-head PR short-circuits to a clean skipped conclusion instead of relying on concurrency cancellation. This makes the losing run report skipped (which GitHub branch protection generally treats as satisfying a required check) instead of a misleading cancelled red X, in the commonly observed case where the pull_request run's setup job evaluates before the push run registers.
It does not eliminate the underlying registration-order race: GitHub's cancel-in-progress: true cancellation decision is made at workflow-run registration time, before any job's if: is evaluated. If a push event's run is genuinely mid-build and a pull_request run for the same commit registers afterward in the same concurrency group, the in-progress push run can still be cancelled by the concurrency subsystem — this fix does not influence that outcome in either direction, since it only changes what the pull_request run's own jobs report once they get a chance to evaluate, not which run "wins" the concurrency slot.
Proposed fix
Append the event name to the concurrency group key, e.g.:
```yaml
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.event.workflow_run.head_branch || github.ref_name }}-${{ github.event_name }}
cancel-in-progress: true
```
so that push and pull_request runs for the same branch never share a concurrency group at all, eliminating the race entirely (rather than just cleaning up its reported status in the common case).
Why this is out of scope for the companion fix
This is a materially larger, separately-scoped change — it needs its own review of every other place this workflow (and any workflow depending on its workflow_run completion, i.e. downstream consumers keyed on workflow_run.head_branch) assumes a shared concurrency group per branch, to confirm nothing relies on push and pull_request runs for the same branch currently deduplicating against each other via the shared group. That review is deliberately deferred to keep the companion fix a tight, low-risk, single-line functional change.
References
Background
.github/workflows/docker-build.yml'sconcurrency:group key is:```yaml
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.event.workflow_run.head_branch || github.ref_name }}
cancel-in-progress: true
```
For a
pushevent,github.head_refis empty, so the group falls back togithub.ref_name(e.g.main). For apull_requestevent whose head branch ismain,github.head_refis literallymain. Both resolve to the identical group string (e.g.Docker Build, Publish & Test-main) whenever a PR's head branch ismainordevelopment(the case for bot-generated "propagate main→development" / weekly promotion sync PRs).What the companion fix (this PR) does and does not solve
A companion PR adds a job-level
if:skip condition to thesetupjob so thepull_request-triggered instance for a main/development-head PR short-circuits to a cleanskippedconclusion instead of relying on concurrency cancellation. This makes the losing run reportskipped(which GitHub branch protection generally treats as satisfying a required check) instead of a misleadingcancelledred X, in the commonly observed case where thepull_requestrun'ssetupjob evaluates before thepushrun registers.It does not eliminate the underlying registration-order race: GitHub's
cancel-in-progress: truecancellation decision is made at workflow-run registration time, before any job'sif:is evaluated. If apushevent's run is genuinely mid-build and apull_requestrun for the same commit registers afterward in the same concurrency group, the in-progresspushrun can still be cancelled by the concurrency subsystem — this fix does not influence that outcome in either direction, since it only changes what thepull_requestrun's own jobs report once they get a chance to evaluate, not which run "wins" the concurrency slot.Proposed fix
Append the event name to the concurrency group key, e.g.:
```yaml
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.event.workflow_run.head_branch || github.ref_name }}-${{ github.event_name }}
cancel-in-progress: true
```
so that
pushandpull_requestruns for the same branch never share a concurrency group at all, eliminating the race entirely (rather than just cleaning up its reported status in the common case).Why this is out of scope for the companion fix
This is a materially larger, separately-scoped change — it needs its own review of every other place this workflow (and any workflow depending on its
workflow_runcompletion, i.e. downstream consumers keyed onworkflow_run.head_branch) assumes a shared concurrency group per branch, to confirm nothing relies onpushandpull_requestruns for the same branch currently deduplicating against each other via the shared group. That review is deliberately deferred to keep the companion fix a tight, low-risk, single-line functional change.References
docs/plans/current_spec.md("Plan: Skip redundantpull_requestdocker-build run for main/development-head PRs"), §3.4.