From 62d82eae290f7198f6988bc210dfb84dfc065dcf Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Fri, 5 Jun 2026 12:12:55 -0400 Subject: [PATCH] Add cancel-in-progress concurrency to reusable CI (#38) 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 ce88647..8d735bd 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 85c6cfb..dd1f5d9 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@v6 diff --git a/.github/workflows/ci-typescript-cdk.yaml b/.github/workflows/ci-typescript-cdk.yaml index ac7e9a7..f3ac699 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@v6