From 8589bfc03ffdb30085c82155f11fc2bac617d146 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Sat, 4 Apr 2026 17:28:34 +0100 Subject: [PATCH] ci: add concurrency groups to cancel redundant workflow runs Prevents redundant CI runs when new commits are pushed to a PR branch, saving runner time and reducing queue contention. --- .github/workflows/claude-code-review.yml | 4 ++++ .github/workflows/cloudshop-example.yml | 4 ++++ .github/workflows/codeql.yml | 4 ++++ .github/workflows/deploy-pages-test.yml | 4 ++++ .github/workflows/deploy-pages.yml | 6 +++++- .github/workflows/dotnet-build-different-locale.yml | 4 ++++ .github/workflows/dotnet.yml | 4 ++++ 7 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index c55fc9b552..d5823c9063 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -16,6 +16,10 @@ on: required: true type: number +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: claude-review: # Optional: Filter by PR author diff --git a/.github/workflows/cloudshop-example.yml b/.github/workflows/cloudshop-example.yml index 141c19d67e..09a475a682 100644 --- a/.github/workflows/cloudshop-example.yml +++ b/.github/workflows/cloudshop-example.yml @@ -7,6 +7,10 @@ on: branches: ["main"] workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: integration-tests: runs-on: ubuntu-latest diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2bd6730e81..1af9fb5010 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -19,6 +19,10 @@ on: schedule: - cron: '0 0 * * 5' +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: analyze: name: Analyze (${{ matrix.language }}) diff --git a/.github/workflows/deploy-pages-test.yml b/.github/workflows/deploy-pages-test.yml index f7dddc272e..31977319c2 100644 --- a/.github/workflows/deploy-pages-test.yml +++ b/.github/workflows/deploy-pages-test.yml @@ -5,6 +5,10 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: test-deploy: name: Test Deploy to GitHub Pages diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 2040177ff8..7d09c35602 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -4,7 +4,11 @@ on: push: branches: - main - + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + permissions: contents: write diff --git a/.github/workflows/dotnet-build-different-locale.yml b/.github/workflows/dotnet-build-different-locale.yml index 21309e9d00..6e10919bee 100644 --- a/.github/workflows/dotnet-build-different-locale.yml +++ b/.github/workflows/dotnet-build-different-locale.yml @@ -4,6 +4,10 @@ on: pull_request: branches: ["main"] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: modularpipeline: strategy: diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index b371771891..439480e68f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -14,6 +14,10 @@ on: type: boolean required: true +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: modularpipeline: environment: ${{ github.ref == 'refs/heads/main' && 'Production' || 'Pull Requests' }}