Skip to content

Commit dcbffd8

Browse files
committed
Cancel outdated runs of the same workflow
It's useful not to finish workflow and free runners after pushing new changes into the same branch. In most cases, you don't need previous results
1 parent 6be3a24 commit dcbffd8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.github/workflows/gradle-build-with-detekt.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: Gradle Build With Detekt
22

33
on: [push, pull_request]
44

5+
# Allow cancelling all previous runs for the same branch
6+
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
511
jobs:
612
build:
713
runs-on: ubuntu-20.04

.github/workflows/gradle-build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: Gradle Build
22

33
on: [push, pull_request]
44

5+
# Allow cancelling all previous runs for the same branch
6+
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
511
jobs:
612
build:
713
runs-on: ubuntu-20.04

0 commit comments

Comments
 (0)