From 8f8536a805c0c17cae506bc4d1ca1cb61216fb70 Mon Sep 17 00:00:00 2001 From: Void Date: Mon, 9 Nov 2026 22:50:10 +0000 Subject: [PATCH] CI: cancel superseded runs with workflow concurrency groups The forge runner takes one job at a time, so every superseded push or PR sync piled up behind the one before it and the dev preview run waited behind runs for merged heads. Pull-request workflows get a group per workflow and PR number; the dev preview gets its own group, so a newer dev push cancels an older one and PR runs never cancel it. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/build-pull-request.yml | 4 ++++ .github/workflows/docker-pr.yml | 4 ++++ .github/workflows/lockfile.yml | 4 ++++ .github/workflows/rat-dev-preview.yml | 7 +++++++ 4 files changed, 19 insertions(+) diff --git a/.github/workflows/build-pull-request.yml b/.github/workflows/build-pull-request.yml index 4ff842ed..964add54 100644 --- a/.github/workflows/build-pull-request.yml +++ b/.github/workflows/build-pull-request.yml @@ -4,6 +4,10 @@ on: pull_request: types: ['opened', 'synchronize'] +concurrency: + group: ${{ github.workflow }}-pr-${{ github.event.pull_request.number }} + cancel-in-progress: true + jobs: build-pull-request: name: Build pull request diff --git a/.github/workflows/docker-pr.yml b/.github/workflows/docker-pr.yml index 997aba6d..24b9389c 100644 --- a/.github/workflows/docker-pr.yml +++ b/.github/workflows/docker-pr.yml @@ -6,6 +6,10 @@ on: - 'Dockerfile' - '.github/workflows/docker-pr.yml' +concurrency: + group: ${{ github.workflow }}-pr-${{ github.event.pull_request.number }} + cancel-in-progress: true + jobs: docker-build: runs-on: ubuntu-latest diff --git a/.github/workflows/lockfile.yml b/.github/workflows/lockfile.yml index a9cc1a34..e96d2818 100644 --- a/.github/workflows/lockfile.yml +++ b/.github/workflows/lockfile.yml @@ -5,6 +5,10 @@ on: paths: - 'package-lock.json' +concurrency: + group: ${{ github.workflow }}-pr-${{ github.event.pull_request.number }} + cancel-in-progress: true + jobs: lockfile_changes: runs-on: ubuntu-latest diff --git a/.github/workflows/rat-dev-preview.yml b/.github/workflows/rat-dev-preview.yml index 45da8bc4..47f22b7e 100644 --- a/.github/workflows/rat-dev-preview.yml +++ b/.github/workflows/rat-dev-preview.yml @@ -4,6 +4,13 @@ on: push: branches: ['dev'] +# One run per ref wins: a newer push to dev cancels the older queued or running one, so the run +# that builds rat-dev-dist is always the newest. Pull-request runs are other workflows and other +# groups; they never cancel it. +concurrency: + group: rat-dev-preview + cancel-in-progress: true + jobs: build: name: Build dev preview -- 2.47.3