Skip to content

Commit

Permalink
Merge pull request Icinga#9636 from Icinga/gha-cancel
Browse files Browse the repository at this point in the history
GHA: let GitHub cancel redundant jobs
  • Loading branch information
julianbrost authored Jan 20, 2023
2 parents c3e4098 + 1d8cffe commit d29ff62
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 28 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/deb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- 'support/*'
pull_request: {}

concurrency:
group: deb-${{ github.ref }}
cancel-in-progress: true

jobs:
deb:
name: .deb
Expand All @@ -31,13 +35,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Cancel previous jobs for the same PR
if: "github.event_name == 'pull_request'"
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc
with:
workflow_id: deb.yml,docker.yml,raspbian.yml,rpm.yml,windows.yml
access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout HEAD
uses: actions/checkout@v1

Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
types:
- published

concurrency:
group: docker-${{ github.ref }}
cancel-in-progress: true

jobs:
docker-release:
if: github.event_name == 'release'
Expand All @@ -27,13 +31,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Cancel previous jobs for the same PR
if: "github.event_name == 'pull_request'"
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc
with:
workflow_id: deb.yml,docker.yml,raspbian.yml,rpm.yml,windows.yml
access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Docker image
uses: Icinga/docker-icinga2@master
with:
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/raspbian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- 'support/*'
pull_request: {}

concurrency:
group: raspbian-${{ github.ref }}
cancel-in-progress: true

jobs:
raspbian:
name: Raspbian
Expand All @@ -20,13 +24,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Cancel previous jobs for the same PR
if: "github.event_name == 'pull_request'"
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc
with:
workflow_id: deb.yml,docker.yml,raspbian.yml,rpm.yml,windows.yml
access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout HEAD
uses: actions/checkout@v1

Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- 'support/*'
pull_request: {}

concurrency:
group: rpm-${{ github.ref }}
cancel-in-progress: true

jobs:
rpm:
name: .rpm (${{ matrix.distro.name }}, ${{ matrix.distro.release }})
Expand Down Expand Up @@ -43,13 +47,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Cancel previous jobs for the same PR
if: "github.event_name == 'pull_request'"
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc
with:
workflow_id: deb.yml,docker.yml,raspbian.yml,rpm.yml,windows.yml
access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Vars
id: vars
env:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- 'support/*'
pull_request: {}

concurrency:
group: windows-${{ github.ref }}
cancel-in-progress: true

jobs:
windows:
name: Windows
Expand Down

0 comments on commit d29ff62

Please sign in to comment.