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.
This commit is contained in:
Wolfgang Walther
2024-02-22 20:12:18 +01:00
committed by Wolfgang Walther
parent f9fdf666ad
commit 333f8cf592
2 changed files with 7 additions and 2 deletions
+2 -2
View File
@@ -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:
+5
View File
@@ -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