Skip to content

Commit 5534706

Browse files
committed
Enable GitHub actions cancel-in-progress for PRs
Pushing many commits to a pull request in a short amount of time can stall the merge builds and also wastes energy unnecessarily. github.head_ref is only set for pull requests. For the main branches we fall back to github.run_id which is unique and always available.
1 parent 7202fe1 commit 5534706

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.github/workflows/push.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ on:
1717
pull_request:
1818
branches:
1919
- '**'
20+
concurrency:
21+
group: ${{ github.head_ref || github.run_id }}
22+
cancel-in-progress: true
2023
env:
2124
CC: ccache gcc
2225
CXX: ccache g++

0 commit comments

Comments
 (0)