Skip to content

Commit

Permalink
Cancel outdated runs of the same workflow
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Undin committed Nov 17, 2023
1 parent 6be3a24 commit dcbffd8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/gradle-build-with-detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Gradle Build With Detekt

on: [push, pull_request]

# Allow cancelling all previous runs for the same branch
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-20.04
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Gradle Build

on: [push, pull_request]

# Allow cancelling all previous runs for the same branch
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

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

0 comments on commit dcbffd8

Please sign in to comment.