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/**"] branches: [main, "release/**"]
workflow_dispatch: workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs: jobs:
go_test_short: go_test_short:
env: env:

View file

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

View file

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

View file

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

View file

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

View file

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