Skip to content

Commit 2acd074

Browse files
committed
Cancel previous CI workflow runs when a PR is updated
Add workflow-level concurrency groups to e2e-deployment, infra-verify, disconnected-dry-run, and build-push-tarball workflows. Uses PR number for grouping so only same-PR runs cancel each other. Non-PR triggers (schedule, dispatch) fall back to run_id so do not cancel each other.
1 parent 992b189 commit 2acd074

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

.github/workflows/build-push-tarball.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
merge_group:
1414
types: [checks_requested]
1515

16+
# Cancel previous runs when a PR is updated
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
19+
cancel-in-progress: true
20+
1621
permissions:
1722
contents: read
1823
pull-requests: write

.github/workflows/disconnected-dry-run.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ name: Disconnected Dry-Run
99
# 2. Automatic: On every PR
1010
# 3. Scheduled: Daily at 11:00 PM EST (04:00 UTC)
1111

12+
# Cancel previous runs when a PR is updated
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
15+
cancel-in-progress: true
16+
1217
on:
1318
schedule:
1419
# Run daily at 11:00 PM EST (04:00 UTC)
@@ -34,11 +39,6 @@ on:
3439
permissions:
3540
contents: read
3641

37-
# Allow parallel execution with unique cluster names per run
38-
concurrency:
39-
group: disconnected-dry-run-${{ github.run_id }}
40-
cancel-in-progress: false
41-
4242
jobs:
4343
disconnected-dry-run:
4444
name: Disconnected Dry-Run Test

.github/workflows/e2e-deployment.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ name: E2E Deployment
99
# Both jobs run on every PR and nightly schedule. Manual dispatch allows
1010
# selecting which modes to run, skipping cleanup, and sending Slack notifications.
1111

12+
# Cancel previous runs when a PR is updated
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
15+
cancel-in-progress: true
16+
1217
on:
1318
schedule:
1419
# Run daily at 10:00 PM EST (03:00 UTC)

.github/workflows/infra-verify.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ on:
77
merge_group:
88
types: [checks_requested]
99

10-
# Allow parallel execution with unique cluster names per run
11-
# Each job gets isolated VMs, networks, and resources
10+
# Cancel previous runs when a PR is updated
1211
concurrency:
13-
group: enclave-ci-${{ github.run_id }}
14-
cancel-in-progress: false
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
13+
cancel-in-progress: true
1514

1615
jobs:
1716
infra-verify:

0 commit comments

Comments
 (0)