From 1552f31de81797b41b777bf6da505b13949189fc Mon Sep 17 00:00:00 2001 From: askalf <263217947+askalf@users.noreply.github.com> Date: Wed, 23 Sep 2026 11:52:37 -0400 Subject: [PATCH 1/2] ci: push and schedule runs get their own concurrency group; only PR runs cancel each other GitHub keeps one pending run per concurrency group, so the shared workflow/ref group let a newer push replace a queued default-branch run. Non-PR events now group by run id; PR runs still share a per-branch group and cancel the superseded run. --- .github/workflows/build.yml | 8 +++++--- .github/workflows/ci.yml | 8 +++++--- .github/workflows/codeql.yml | 8 +++++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index af0035f..eaa542a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,10 +14,12 @@ on: permissions: contents: read -# Cancel a superseded PR run; let push and schedule runs finish so a -# default-branch result is never dropped. +# A PR's runs share one group per branch, so a new push cancels the superseded +# run. Push and schedule runs each get their own group (the run id): GitHub keeps +# only one pending run per group, so a shared group would let a newer push +# replace a queued default-branch run. concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2403f8..9999398 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,10 +8,12 @@ on: permissions: contents: read -# Cancel a superseded PR run; let push and schedule runs finish so a -# default-branch result is never dropped. +# A PR's runs share one group per branch, so a new push cancels the superseded +# run. Push and schedule runs each get their own group (the run id): GitHub keeps +# only one pending run per group, so a shared group would let a newer push +# replace a queued default-branch run. concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 123ea37..bbf1ed4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -11,10 +11,12 @@ on: permissions: contents: read -# Cancel a superseded PR run; let push and schedule runs finish so a -# default-branch result is never dropped. +# A PR's runs share one group per branch, so a new push cancels the superseded +# run. Push and schedule runs each get their own group (the run id): GitHub keeps +# only one pending run per group, so a shared group would let a newer push +# replace a queued default-branch run. concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: From d5c18748397fb39af817649897cd57920e0c5d08 Mon Sep 17 00:00:00 2001 From: askalf <263217947+askalf@users.noreply.github.com> Date: Wed, 23 Sep 2026 17:41:10 -0400 Subject: [PATCH 2/2] Drop the rationale comment above the concurrency blocks The expressions are self-describing; the reasoning stays in the PR description. --- .github/workflows/build.yml | 4 ---- .github/workflows/ci.yml | 4 ---- .github/workflows/codeql.yml | 4 ---- 3 files changed, 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eaa542a..25c4579 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,10 +14,6 @@ on: permissions: contents: read -# A PR's runs share one group per branch, so a new push cancels the superseded -# run. Push and schedule runs each get their own group (the run id): GitHub keeps -# only one pending run per group, so a shared group would let a newer push -# replace a queued default-branch run. concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9999398..457a13b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,10 +8,6 @@ on: permissions: contents: read -# A PR's runs share one group per branch, so a new push cancels the superseded -# run. Push and schedule runs each get their own group (the run id): GitHub keeps -# only one pending run per group, so a shared group would let a newer push -# replace a queued default-branch run. concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index bbf1ed4..c9c772c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -11,10 +11,6 @@ on: permissions: contents: read -# A PR's runs share one group per branch, so a new push cancels the superseded -# run. Push and schedule runs each get their own group (the run id): GitHub keeps -# only one pending run per group, so a shared group would let a newer push -# replace a queued default-branch run. concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} cancel-in-progress: ${{ github.event_name == 'pull_request' }}