Skip to content

Commit 657b6cd

Browse files
authored
[PATCH] Add cancel-in-progress concurrency block to PR-triggered consumer workflows (#53)
## Summary - Adds a `concurrency:` block to `CheckCompatBounds.yml`, `CodeQL.yml`, `FormatCheck.yml`, `IntegrationTest.yml`, and `VersionCheck.yml` so a new push to a PR cancels the prior in-flight run for that workflow. - Matches the behavior already present in `Tests.yml` and `Documentation.yml`. Without this, redundant CI runs accumulate on rapid pushes to a PR. - `cancel-in-progress` is gated on `refs/pull/`, so cancellation only fires on PR refs and never on `main`/tag pushes. Co-authored-by: ITensorBot <278814285+ITensorBot@users.noreply.github.com>
1 parent e9718df commit 657b6cd

5 files changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/CheckCompatBounds.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: "CheckCompatBounds"
22
on:
33
pull_request: ~
4+
concurrency:
5+
group: "${{ github.workflow }}-${{ github.ref }}"
6+
cancel-in-progress: "${{ startsWith(github.ref, 'refs/pull/') }}"
47
permissions:
58
contents: "read"
69
jobs:

.github/workflows/CodeQL.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
pull_request:
44
branches:
55
- "main"
6+
concurrency:
7+
group: "${{ github.workflow }}-${{ github.ref }}"
8+
cancel-in-progress: "${{ startsWith(github.ref, 'refs/pull/') }}"
69
permissions:
710
contents: "read"
811
security-events: "write"

.github/workflows/FormatCheck.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- "synchronize"
77
- "reopened"
88
- "ready_for_review"
9+
concurrency:
10+
group: "${{ github.workflow }}-${{ github.ref }}"
11+
cancel-in-progress: "${{ startsWith(github.ref, 'refs/pull/') }}"
912
permissions:
1013
contents: "read"
1114
jobs:

.github/workflows/IntegrationTest.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- "reopened"
1212
- "ready_for_review"
1313
- "converted_to_draft"
14+
concurrency:
15+
group: "${{ github.workflow }}-${{ github.ref }}"
16+
cancel-in-progress: "${{ startsWith(github.ref, 'refs/pull/') }}"
1417
permissions:
1518
actions: "read"
1619
contents: "read"

.github/workflows/VersionCheck.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: "VersionCheck"
22
on:
33
pull_request: ~
4+
concurrency:
5+
group: "${{ github.workflow }}-${{ github.ref }}"
6+
cancel-in-progress: "${{ startsWith(github.ref, 'refs/pull/') }}"
47
permissions:
58
contents: "read"
69
pull-requests: "read"

0 commit comments

Comments
 (0)