Skip to content

Commit dbb035f

Browse files
roomoteedelauna
authored andcommitted
ci: cancel superseded PR runs in validation workflows
Code QA, mocked E2E, CodeQL, and Release Validation kept running every push to a pull request, so older commits queued and ran to completion wasted. Add workflow-level concurrency groups keyed by the pull request number with cancel-in-progress only for pull_request events; other events get unique run_id groups, so main, release, merge-queue, and manual runs keep their current behavior. Refs #2289
1 parent a15ba8c commit dbb035f

4 files changed

Lines changed: 24 additions & 0 deletions

File tree

‎.github/workflows/code-qa.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ on:
99
merge_group:
1010
types: [checks_requested]
1111

12+
# Cancel superseded runs when a pull request is updated. Non-PR events keep
13+
# unique groups, so main, merge-queue, and manual runs are never cancelled.
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
16+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
17+
1218
# Least privilege: every job below escalates only where it needs to.
1319
permissions:
1420
contents: read

‎.github/workflows/codeql.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
schedule:
88
- cron: "24 19 * * 3"
99

10+
# Cancel superseded runs when a pull request is updated. Non-PR events keep
11+
# unique groups, so main pushes and scheduled scans are never cancelled.
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
1016
# Least privilege: the analyze job escalates to security-events: write via its
1117
# own job-level permissions block.
1218
permissions:

‎.github/workflows/e2e.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
merge_group:
88
types: [checks_requested]
99

10+
# Cancel superseded runs when a pull request is updated. Non-PR events keep
11+
# unique groups, so merge-queue and manual runs are never cancelled.
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
1016
permissions:
1117
contents: read
1218

‎.github/workflows/release-validation.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ on:
1616
- "releases/**"
1717
- ".github/workflows/release-validation.yml"
1818

19+
# Cancel superseded runs when a pull request is updated. Non-PR events keep
20+
# unique groups, so manual runs are never cancelled.
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
23+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
24+
1925
permissions:
2026
contents: read
2127

0 commit comments

Comments
 (0)