Skip to content

Commit

Permalink
Enable GitHub actions cancel-in-progress for PRs
Browse files Browse the repository at this point in the history
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
  • Loading branch information
iluuu1994 committed Mar 7, 2023
1 parent 7c1ee5a commit cfe1aab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/push.yml
Expand Up @@ -17,6 +17,9 @@ on:
pull_request:
branches:
- '**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.url || github.run_id }}
cancel-in-progress: true
env:
CC: ccache gcc
CXX: ccache g++
Expand Down

0 comments on commit cfe1aab

Please sign in to comment.