Skip to content

Commit

Permalink
Cancel previous builds within the same PR on push
Browse files Browse the repository at this point in the history
  • Loading branch information
npaun committed Aug 27, 2024
1 parent 290b54c commit b1c6165
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/fixup.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: "Just say no to fixup commits"
on:
pull_request:
types: [synchronize, opened, reopened]
workflow_call:

jobs:
block-fixup:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Based on https://www.neilmacy.co.uk/blog/github-action-to-block-merging
name: "Internal PR Required"
on:
workflow_call:
pull_request:
types: [synchronize, opened, reopened, labeled, unlabeled]
types: [labeled, unlabeled]

jobs:
InternalPRRequired:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
branches:
- main

concurrency:
# Cancel existing builds for the same PR.
# Otherwise, all other builds will be allowed to run through.
group: lint.yml-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-24.04
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@ on:
branches:
- main

concurrency:
# Cancel existing builds for the same PR.
# Otherwise, all other builds will be allowed to run through.
group: test.yml-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true


jobs:
fixup:
uses: ./.github/workflows/fixup.yml
labels:
uses: ./.github/workflows/labels.yml
test:
strategy:
matrix:
Expand Down

0 comments on commit b1c6165

Please sign in to comment.