From 4d319907f6189d61428e75027b5f30c79564b442 Mon Sep 17 00:00:00 2001 From: Stefan Kuhn Date: Sun, 6 Sep 2026 14:51:32 +0200 Subject: [PATCH] ci: cancel superseded test runs with concurrency groups Use concurrency groups based on the workflow and PR number or Git ref. Cancel an in-progress run when a newer run uses the same group, freeing CI capacity from outdated tests. Release events use a separate suffix to keep them distinct where applicable. --- .github/workflows/test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6c95ce2..9b772a5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,6 +4,12 @@ on: pull_request: workflow_dispatch: +# Group runs by workflow and PR/ref; release-triggered runs use a separate +# `-release` suffix. Cancel an older run when a new one uses the same group. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}${{ github.event_name == 'release' && '-release' || '' }} + cancel-in-progress: true + jobs: test: uses: bats-core/.github/.github/workflows/test.yml@v1