From e3773b50909220d7103bf74e92d6907960d46ac5 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 11 Nov 2026 17:57:01 -0600 Subject: [PATCH] [ci] Cancel superseded pull-request workflow runs Group pull-request runs by workflow and PR number so new commits cancel older queued or running checks. Give non-PR runs unique groups, leaving main-branch builds and tag releases independent. Validation: actionlint; workflow concurrency assertions; meson test -C build (302 passed, one skipped). Assisted-by: OpenAI Codex --- .github/workflows/arm.yml | 4 ++++ .github/workflows/c++-versions.yml | 4 ++++ .github/workflows/cifuzz.yml | 4 ++++ .github/workflows/configs-build.yml | 4 ++++ .github/workflows/crossbuild-mingw.yml | 4 ++++ .github/workflows/docs.yml | 4 ++++ .github/workflows/linux.yml | 4 ++++ .github/workflows/macos.yml | 4 ++++ .github/workflows/msvc.yml | 4 ++++ .github/workflows/msys2.yml | 4 ++++ .github/workflows/rust.yml | 4 ++++ .github/workflows/sanitizers.yml | 4 ++++ .github/workflows/valgrind.yml | 4 ++++ 13 files changed, 52 insertions(+) diff --git a/.github/workflows/arm.yml b/.github/workflows/arm.yml index 120561ca2..733ba546b 100644 --- a/.github/workflows/arm.yml +++ b/.github/workflows/arm.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ main ] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read diff --git a/.github/workflows/c++-versions.yml b/.github/workflows/c++-versions.yml index 93a0a7dad..cf8730246 100644 --- a/.github/workflows/c++-versions.yml +++ b/.github/workflows/c++-versions.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ main ] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml index f5bf6e56b..aaa8a69b4 100644 --- a/.github/workflows/cifuzz.yml +++ b/.github/workflows/cifuzz.yml @@ -1,6 +1,10 @@ name: CIFuzz on: [pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read diff --git a/.github/workflows/configs-build.yml b/.github/workflows/configs-build.yml index 84e892ae5..f6e399e9a 100644 --- a/.github/workflows/configs-build.yml +++ b/.github/workflows/configs-build.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ main ] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read diff --git a/.github/workflows/crossbuild-mingw.yml b/.github/workflows/crossbuild-mingw.yml index 9be9d8aba..646ca91c1 100644 --- a/.github/workflows/crossbuild-mingw.yml +++ b/.github/workflows/crossbuild-mingw.yml @@ -7,6 +7,10 @@ on: pull_request: branches: [ main ] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f9d9725e9..b6bd42c97 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,6 +7,10 @@ on: pull_request: branches: [ main ] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a99fc82a2..c98ee02f3 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -7,6 +7,10 @@ on: pull_request: branches: [ main ] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 8bf8815fa..44644d1b9 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ main ] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index 814736059..f89d528f4 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ main ] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read diff --git a/.github/workflows/msys2.yml b/.github/workflows/msys2.yml index aec586979..ca6392a1d 100644 --- a/.github/workflows/msys2.yml +++ b/.github/workflows/msys2.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ main ] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 64b944a6f..7a65be762 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ main ] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml index 302ea5c15..b693f7211 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/sanitizers.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ main ] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read diff --git a/.github/workflows/valgrind.yml b/.github/workflows/valgrind.yml index 44db3dee7..4f53fbb60 100644 --- a/.github/workflows/valgrind.yml +++ b/.github/workflows/valgrind.yml @@ -6,6 +6,10 @@ on: pull_request: branches: [ main ] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: contents: read