Skip to content

Commit

Permalink
Cancel in progress CI jobs for PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Oct 24, 2023
1 parent be7ea3a commit 996849d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
pull_request:
workflow_dispatch:

concurrency:
# group by workflow and ref; the last slightly strange component ensures that for pull
# requests, we limit to 1 concurrent job, but for the master branch we don't
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }}
# Cancel intermediate builds, but only if it is a pull request build.
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
runs-on: ${{ matrix.os }}
Expand Down

0 comments on commit 996849d

Please sign in to comment.