Skip to content

Commit f483f61

Browse files
garth-wellsclaude
andcommitted
Cancel superseded pull request runs
A new commit on a pull request makes the previous run's result irrelevant, but the runners keep going: pushing three commits in quick succession earlier today left nine Spack legs building a superseded commit for close to two hours. Add a concurrency group to the seven workflows that run on 'pull_request'. Cancellation is limited to that event, so pushes to 'main' and 'release' still finish -- the Spack workflow populates the build cache from them, and a cancelled run skips those push steps. Merge queue runs are unaffected: they carry a 'refs/heads/gh-readonly-queue/...' ref, so they form their own group, and 'cancel-in-progress' is false for anything that is not a pull request. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 44bb58d commit f483f61

7 files changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/ccpp.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ on:
1515
- main
1616
workflow_dispatch:
1717

18+
# Cancel superseded runs: a new commit on a pull request makes the
19+
# previous run's result irrelevant. Pushes to 'main' and 'release' are
20+
# left to finish, since they populate caches and publish artefacts.
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
24+
1825
jobs:
1926

2027
lint:

.github/workflows/ci-spack.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ on:
1414
- main
1515
workflow_dispatch:
1616

17+
# Cancel superseded runs: a new commit on a pull request makes the
18+
# previous run's result irrelevant. Pushes to 'main' and 'release' are
19+
# left to finish, since they populate caches and publish artefacts.
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
23+
1724
env:
1825
GITHUB_USER: ${{ github.actor }}
1926
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ on:
1010
- main
1111
workflow_dispatch:
1212

13+
# Cancel superseded runs: a new commit on a pull request makes the
14+
# previous run's result irrelevant. Pushes to 'main' and 'release' are
15+
# left to finish, since they populate caches and publish artefacts.
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
19+
1320
env:
1421
GITHUB_USER: ${{ github.actor }}
1522
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/conda.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ on:
1616
- cron: "0 2 * * WED"
1717
workflow_dispatch: ~
1818

19+
# Cancel superseded runs: a new commit on a pull request makes the
20+
# previous run's result irrelevant. Pushes to 'main' and 'release' are
21+
# left to finish, since they populate caches and publish artefacts.
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
25+
1926
env:
2027
UCX_TLS: tcp # Use TCP only, avoiding InfiniBand/MANA
2128

.github/workflows/macos.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ on:
1515
- main
1616
workflow_dispatch:
1717

18+
# Cancel superseded runs: a new commit on a pull request makes the
19+
# previous run's result irrelevant. Pushes to 'main' and 'release' are
20+
# left to finish, since they populate caches and publish artefacts.
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.ref }}
23+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
24+
1825
jobs:
1926

2027
mac-os-build:

.github/workflows/sonarcloud.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ on:
1212
workflow_dispatch:
1313

1414

15+
# Cancel superseded runs: a new commit on a pull request makes the
16+
# previous run's result irrelevant. Pushes to 'main' and 'release' are
17+
# left to finish, since they populate caches and publish artefacts.
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
21+
1522
jobs:
1623
sonarcloud-build:
1724
name: Build

.github/workflows/windows.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ on:
1212
- main
1313
workflow_dispatch:
1414

15+
# Cancel superseded runs: a new commit on a pull request makes the
16+
# previous run's result irrelevant. Pushes to 'main' and 'release' are
17+
# left to finish, since they populate caches and publish artefacts.
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
21+
1522
jobs:
1623

1724
windows-build:

0 commit comments

Comments
 (0)