Skip to content

Commit ea97686

Browse files
committed
Set default permissions to "read-all"
Only some actions need "contents: write", set on job level.
1 parent 561344c commit ea97686

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ on:
2020
schedule:
2121
- cron: '43 21 * * 6'
2222

23-
permissions:
24-
contents: read
23+
# Declare default permissions as read only.
24+
permissions: read-all
2525

2626
concurrency:
2727
group: codeql-${{ github.ref }}

.github/workflows/dependency-review.yml

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

12-
permissions:
13-
contents: write
12+
# Declare default permissions as read only.
13+
permissions: read-all
1414

1515
concurrency:
1616
group: dependency-review-${{ github.ref }}

.github/workflows/maven-ci-and-prb.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ on:
2424
pull_request:
2525
branches: [s3mock-v2, main]
2626

27-
permissions:
28-
contents: read
27+
# Declare default permissions as read only.
28+
permissions: read-all
2929

3030
concurrency:
3131
group: ci-${{ github.ref }}
@@ -34,7 +34,8 @@ concurrency:
3434
jobs:
3535
build:
3636
runs-on: ubuntu-latest
37-
37+
permissions:
38+
contents: write
3839
steps:
3940
- name: Harden Runner
4041
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0

.github/workflows/maven-release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,15 @@
1919
name: Maven Release
2020

2121
on: workflow_dispatch
22+
23+
# Declare default permissions as read only.
24+
permissions: read-all
25+
2226
jobs:
2327
build:
2428
runs-on: ubuntu-latest
25-
29+
permissions:
30+
contents: write
2631
steps:
2732
- name: Harden Runner
2833
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0

.github/workflows/sbom.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ concurrency:
88
group: sbom-${{ github.ref }}
99
cancel-in-progress: ${{ github.ref_name != 'main' }}
1010

11+
# Declare default permissions as read only.
12+
permissions: read-all
13+
1114
jobs:
1215
build:
1316
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)