Skip to content

Commit 9cc761e

Browse files
committed
Cancel running workflows from same PR/branch/tag when new workflow is triggered
1 parent c1bd648 commit 9cc761e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.github/workflows/docker-image.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
pull_request:
77
branches: ["main"]
88

9+
# To cancel a currently running workflow from the same PR, branch, or tag
10+
# when a new workflow is triggered.
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
915
jobs:
1016

1117
build:

.github/workflows/maven.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ on:
1414
pull_request:
1515
branches: ["main"]
1616

17+
# To cancel a currently running workflow from the same PR, branch, or tag
18+
# when a new workflow is triggered.
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: true
22+
1723
jobs:
1824
build:
1925
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)