Skip to content

Commit

Permalink
Support cancelling previous ci actions (#225)
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?
Support cancelling previous ci actions when new commits are submitted.

### Why are the changes needed?
I hope the CI actions can always test the latest commits code and cancel the previous ci when new commits are submitted.

Refer to: https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
No need

Co-authored-by: Kaijie Chen <ckj@apache.org>
  • Loading branch information
zuston and kaijchen committed Sep 19, 2022
1 parent b9bc7ce commit 9f6b3e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ name: build

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}


jobs:
checkstyle:
uses: ./.github/workflows/sequential.yml
Expand Down

0 comments on commit 9f6b3e5

Please sign in to comment.