Skip to content

Commit

Permalink
Cancel stale CI executions when CI is re-triggered in the same branch…
Browse files Browse the repository at this point in the history
…/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]>
  • Loading branch information
WojciechMazur and tgodzik authored Nov 21, 2024
1 parent bd07317 commit 2be2a60
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ on:
- cron: '0 3 * * *' # Every day at 3 AM
workflow_dispatch:

# 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
# - terminate previous on-push CI run after merging new PR to main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

env:
DOTTY_CI_RUN: true
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
Expand Down

0 comments on commit 2be2a60

Please sign in to comment.