Skip to content

Commit d0f9a92

Browse files
Cancel stale CI executions when CI is re-triggered in the same branch/PR (scala#21974)
Cancels any in-progress runs within the same group identified by workflow name and GH reference (branch or tag) For example it would: - terminate previous PR CI execution after pushing more changes to the same PR branch Co-authored-by: Tomasz Godzik <[email protected]> [Cherry-picked 2be2a60]
1 parent e673804 commit d0f9a92

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ on:
2727
- cron: '0 3 * * *' # Every day at 3 AM
2828
workflow_dispatch:
2929

30+
# Cancels any in-progress runs within the same group identified by workflow name and GH reference (branch or tag)
31+
# For example it would:
32+
# - terminate previous PR CI execution after pushing more changes to the same PR branch
33+
# - terminate previous on-push CI run after merging new PR to main
34+
concurrency:
35+
group: ${{ github.workflow }}-${{ github.ref }}
36+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
37+
3038
env:
3139
DOTTY_CI_RUN: true
3240

0 commit comments

Comments
 (0)