Skip to content

Commit 2be2a60

Browse files
Cancel stale CI executions when CI is re-triggered in the same branch/PR (#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]>
1 parent bd07317 commit 2be2a60

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: .github/workflows/ci.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ on:
2626
- cron: '0 3 * * *' # Every day at 3 AM
2727
workflow_dispatch:
2828

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

0 commit comments

Comments
 (0)