Skip to content

Commit 4386262

Browse files
opentelemetrybototelbot[bot]pichlermarctrask
authored
ci: add minimum token permissions for all github workflow files (#2922)
Co-authored-by: otelbot <[email protected]> Co-authored-by: Marc Pichler <[email protected]> Co-authored-by: Trask Stalnaker <[email protected]>
1 parent de22600 commit 4386262

14 files changed

+49
-0
lines changed

.github/workflows/close-stale.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ on:
33
schedule:
44
- cron: '30 6 * * *'
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
stale:
11+
permissions:
12+
issues: write # required for closing stale issues
13+
pull-requests: write # required for closing stale PRs
814
runs-on: ubuntu-latest
915
steps:
1016
- uses: actions/stale@v9

.github/workflows/codeql-analysis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ on:
66
branches: [ main ]
77
pull_request:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
CodeQL-Build:
14+
permissions:
15+
security-events: write # for github/codeql-action/analyze to upload SARIF results
1116
runs-on: ubuntu-latest
1217

1318
steps:

.github/workflows/component-owners.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@ name: 'Component Owners'
22
on:
33
pull_request_target:
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
run_self:
10+
permissions:
11+
pull-requests: write # required for assigning reviewers to PRs
712
runs-on: ubuntu-latest
813
name: Auto Assign Owners
914
steps:

.github/workflows/label-prs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: "Label PR"
22
on:
33
- pull_request_target
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
labeler:
710
name: 'Add component labels'

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
pull_request:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest

.github/workflows/peer-api.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
pull_request:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
peer-api-check:
1114
runs-on: ubuntu-latest

.github/workflows/pr-title.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
- edited
88
- synchronize
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
main:
1215
name: Validate PR title

.github/workflows/release-please-validate.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
pull_request:
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
rp-validate:
1114
runs-on: ubuntu-latest

.github/workflows/release-please.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
branches:
44
- main
55

6+
permissions:
7+
contents: read
8+
69
name: Run Release Please
710
jobs:
811
release-please:

.github/workflows/test-all-versions.pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- labeled
99
- unlabeled
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
parse-labels:
1316
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)