Skip to content

Commit be90481

Browse files
committed
fix(ci): refine workflow cancellation
1 parent a8a788f commit be90481

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

.github/workflows/build_and_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525

2626
concurrency:
2727
group: ${{ github.repository }}-${{ github.event.pull_request.number || github.ref }}-${{ github.workflow }}
28-
cancel-in-progress: true
28+
cancel-in-progress: ${{ github.event_name == 'pull_request' || (github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/release-')) }}
2929

3030
permissions:
3131
contents: read

.github/workflows/build_docs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ on:
3434
- '.github/workflows/build_docs.yaml'
3535

3636
concurrency:
37-
group: ${{ github.workflow }}-${{ github.ref }}
38-
cancel-in-progress: false
37+
group: ${{ github.repository }}-${{ github.event.pull_request.number || github.ref }}-${{ github.workflow }}
38+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
3939

4040
permissions:
4141
contents: read

.github/workflows/gcc8_test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525

2626
concurrency:
2727
group: ${{ github.repository }}-${{ github.event.pull_request.number || github.ref }}-${{ github.workflow }}
28-
cancel-in-progress: true
28+
cancel-in-progress: ${{ github.event_name == 'pull_request' || (github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/release-')) }}
2929

3030
permissions:
3131
contents: read

.github/workflows/license_check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ on:
2626

2727
concurrency:
2828
group: ${{ github.repository }}-${{ github.event.pull_request.number || github.ref }}-${{ github.workflow }}
29-
cancel-in-progress: true
29+
cancel-in-progress: ${{ github.event_name == 'pull_request' || (github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/release-')) }}
3030

3131
jobs:
3232
rat-license-check:

.github/workflows/pre-commit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525

2626
concurrency:
2727
group: ${{ github.repository }}-${{ github.event.pull_request.number || github.ref }}-${{ github.workflow }}
28-
cancel-in-progress: true
28+
cancel-in-progress: ${{ github.event_name == 'pull_request' || (github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/release-')) }}
2929

3030
jobs:
3131
pre-commit:

0 commit comments

Comments
 (0)