From 333f8cf59246831b6040a66547a0d8e14820ece9 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Wed, 21 Feb 2024 19:34:51 +0100 Subject: [PATCH] ci: Cancel all workflows consistently in pull requests without blocking main The previous setup would cause multiple commits on main to be stuck in a pending state, waiting for the previous run to be finished. The new group specification is taken from: https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value This also adds the same settings for the docs workflow. --- .github/workflows/ci.yaml | 4 ++-- .github/workflows/docs.yaml | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2985bf7f8..073e6999e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,9 +13,9 @@ on: - v[0-9]+ concurrency: - group: ${{ github.workflow }}-${{ github.ref }} # Terminate all previous runs of the same workflow for pull requests - cancel-in-progress: "${{ github.event_name == 'pull_request' }}" + group: ci-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: Lint-Style: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 3f2057887..79c4c50aa 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -10,6 +10,11 @@ on: - main - v[0-9]+ +concurrency: + # Terminate all previous runs of the same workflow for pull requests + group: docs-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: build: name: Build docs