From 4a66940500a5ea1ae1d130d0292e6303230736ee Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Fri, 5 Jun 2026 11:41:28 -0400 Subject: [PATCH] Add cancel-in-progress concurrency to reusable CI Superseded CI runs on the same ref keep consuming runners and delay feedback on the latest push. Add a job-level concurrency group keyed on github.workflow and github.ref so a new push cancels the in-flight CI run for that branch. Concurrency is set at the job level rather than the workflow level because these are workflow_call reusable workflows: workflow-level concurrency would resolve github.workflow against the caller's context, collapsing unrelated callers into one group. cd-* deploy workflows are intentionally left untouched to avoid cancelling in-flight deploys. --- .github/workflows/ci-dotnet.yaml | 3 +++ .github/workflows/ci-python-sam.yaml | 3 +++ .github/workflows/ci-typescript-cdk.yaml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/ci-dotnet.yaml b/.github/workflows/ci-dotnet.yaml index e12a927..06b8b2b 100644 --- a/.github/workflows/ci-dotnet.yaml +++ b/.github/workflows/ci-dotnet.yaml @@ -24,6 +24,9 @@ jobs: ci: runs-on: ubuntu-latest timeout-minutes: 20 + concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true defaults: run: working-directory: ${{ inputs.working-directory }} diff --git a/.github/workflows/ci-python-sam.yaml b/.github/workflows/ci-python-sam.yaml index a66dc25..4346167 100644 --- a/.github/workflows/ci-python-sam.yaml +++ b/.github/workflows/ci-python-sam.yaml @@ -48,6 +48,9 @@ jobs: ci: runs-on: ubuntu-latest timeout-minutes: 10 + concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/ci-typescript-cdk.yaml b/.github/workflows/ci-typescript-cdk.yaml index 9d2d6e0..1348861 100644 --- a/.github/workflows/ci-typescript-cdk.yaml +++ b/.github/workflows/ci-typescript-cdk.yaml @@ -60,6 +60,9 @@ jobs: ci: runs-on: ubuntu-latest timeout-minutes: 30 + concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true steps: - uses: actions/checkout@v4