Skip to content

Commit cfe1aab

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. Enable concurrency to cancel workflows of old commits in pull requests. Generate a common group name for pull requests using github.event.pull_request.url with github.run_id as a fallback for branches, which is unique and always available. Closes GH-10799
1 parent 7c1ee5a commit cfe1aab

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.workflow }}-${{ github.event.pull_request.url || github.run_id }}
22+
cancel-in-progress: true
2023
env:
2124
CC: ccache gcc
2225
CXX: ccache g++

0 commit comments

Comments
 (0)