Skip to content

Commit

Permalink
Cancel running workflows from same PR/branch/tag when new workflow is…
Browse files Browse the repository at this point in the history
… triggered
  • Loading branch information
miguno committed Nov 6, 2024
1 parent c1bd648 commit 9cc761e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
pull_request:
branches: ["main"]

# To cancel a currently running workflow from the same PR, branch, or tag
# when a new workflow is triggered.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:

build:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ on:
pull_request:
branches: ["main"]

# To cancel a currently running workflow from the same PR, branch, or tag
# when a new workflow is triggered.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 9cc761e

Please sign in to comment.