chore(ci): restrict each job concurrency except for main branch (#117)

- save some compute minutes 🌱
- Limit concurrency by workflow + ref (except for main branch)
This commit is contained in:
Quentin McGaw 2025-02-06 12:03:26 +01:00 committed by GitHub
parent 80bdfe7243
commit a8df623269
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 24 additions and 0 deletions

View file

@ -7,6 +7,10 @@ on:
branches: [main, "release/**"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
go_test_short:
env:

View file

@ -13,6 +13,10 @@ permissions:
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
golangci:
name: lint

View file

@ -11,6 +11,10 @@ on:
- .github/labels.yml
- .github/workflows/labels.yml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
labeler:
permissions:

View file

@ -7,6 +7,10 @@ on:
branches: [main, "release/**"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
diffs:
runs-on: ubuntu-latest

View file

@ -9,6 +9,10 @@ on:
type: string
default: "2bd6bd01d2e8561dd7fc21b631f4a34ac16627a1"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
rename-module:
runs-on: ubuntu-latest

View file

@ -9,6 +9,10 @@ on:
- ".github/workflows/yml.yml"
- ".github/yamllint.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
yaml-check:
runs-on: ubuntu-latest