Skip to content

Commit be9572a

Browse files
npalmCopilot
andauthored
chore: add concurrent workflow rules (#4855)
This pull request updates several GitHub Actions workflow files to add concurrency controls. The main goal is to prevent multiple runs of the same workflow from executing simultaneously on the same branch or ref, which helps reduce unnecessary resource usage and ensures that only the latest workflow run is active. Most workflows now use a concurrency group based on the workflow name and branch/ref, with `cancel-in-progress` set to `true` so that in-progress runs are canceled when a new run is triggered. Two workflows (`release.yml` and `stale.yml`) use a different concurrency configuration. Concurrency configuration added to workflows: **General concurrency improvements** * Added `concurrency` blocks to `.github/workflows/codeql.yml`, `.github/workflows/dependency-review.yml`, `.github/workflows/lambda.yml`, `.github/workflows/ossf-scorecard.yml`, `.github/workflows/ovs.yml`, `.github/workflows/packer-build.yml`, `.github/workflows/semantic-check.yml`, `.github/workflows/terraform.yml`, `.github/workflows/update-docs.yml`, and `.github/workflows/zizmor.yml` to group runs by workflow name and branch/ref and cancel in-progress runs (`cancel-in-progress: true`). [[1]](diffhunk://#diff-12783128521e452af0cfac94b99b8d250413c516ec71fe6d97dbea666ff7ba27R13-R16) [[2]](diffhunk://#diff-7cdd3ccec44c8ba176bdc3b9ef54c3f56aa210a1a4e2bb5f79d87b1e50314a18R12-R15) [[3]](diffhunk://#diff-b0732b88b9e5a3df48561602571a10179d2b28cbb21ba8032025932bc9606426R11-R14) [[4]](diffhunk://#diff-0f32dffa00fbb4b53f979f3524fd4f69451050cda001ae563ed49e27e702da7bR10-R13) [[5]](diffhunk://#diff-0efa76244190040e37ac26bd58a2e1c1155c0de92da9ddf72276d5354c5c0bf8R8-R11) [[6]](diffhunk://#diff-7d0fae1f42bb015ceff53b783c22a632e3c0aa2a62f4bf6cf3b71cf5c8d8cda1R11-R15) [[7]](diffhunk://#diff-9d577d2550fe414a048906bc0af8ff9188d21f432e41be311e49b3a910fe9ac4R8-R12) [[8]](diffhunk://#diff-10eac00f40a120814e0c56ca5bf5a61c8b335acbdeb977b72207606aa3daea4dR9-R12) [[9]](diffhunk://#diff-6cb924cb587613a1d83384b44ca0c806ccf512202b3f29f529fc6825cef21de2R9-R12) [[10]](diffhunk://#diff-8e6408444d2bf2bed6f02c5dc62a7f1f6ab7337eae098d332986e6a81411aeb7R13-R16) **Special concurrency configuration** * For `.github/workflows/release.yml`, added a concurrency group by workflow name and branch/ref, but set `cancel-in-progress: false` to allow multiple runs to proceed. * For `.github/workflows/stale.yml`, added a concurrency group by workflow name only, with `cancel-in-progress: false`. --------- Co-authored-by: Copilot <[email protected]>
1 parent f5775a9 commit be9572a

File tree

13 files changed

+54
-0
lines changed

13 files changed

+54
-0
lines changed

.github/workflows/codeql.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
schedule:
1111
- cron: '25 19 * * 2'
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
1317
permissions:
1418
contents: read
1519

.github/workflows/dependency-review.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
name: 'Dependency Review'
1010
on: [pull_request]
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
permissions: {}
1317

1418
jobs:

.github/workflows/lambda.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
- 'lambdas/**'
99
- '.github/workflows/lambda.yml'
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
1115
permissions:
1216
contents: read
1317

.github/workflows/ossf-scorecard.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
push:
88
branches: [ "main" ]
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
1014
permissions:
1115
contents: read # for actions/checkout and repository analysis
1216

.github/workflows/ovs.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
merge_group:
66
branches: [main]
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
812
permissions: {}
913

1014
jobs:

.github/workflows/packer-build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
- "images/**"
99
- ".github/workflows/packer-build.yml"
1010
- "module/runners/templates/**"
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1116
permissions:
1217
contents: read
1318

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
- v1
77
workflow_dispatch:
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: false
12+
913
permissions:
1014
contents: read
1115

.github/workflows/semantic-check.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
- opened
66
- edited
77
- synchronize
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
11+
cancel-in-progress: true
12+
813
permissions:
914
contents: read # for actions/checkout
1015
pull-requests: read # for amannn/action-semantic-pull-request to check PR details

.github/workflows/stale.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ on:
33
schedule:
44
- cron: "30 1 * * *"
55
workflow_dispatch:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}
9+
cancel-in-progress: true
10+
611
permissions: {}
712
jobs:
813
stale:

.github/workflows/terraform.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
paths: ["**/*.tf", "**/*.hcl", ".github/workflows/terraform.yml"]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
permissions:
1014
contents: read
1115

0 commit comments

Comments
 (0)