Skip to content

Commit 344c647

Browse files
Add minimum token permissions for all github workflow files (#4663)
1 parent ff9dc82 commit 344c647

15 files changed

+57
-0
lines changed

.github/workflows/backport.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
description: "The pull request # to backport"
77
required: true
88

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

.github/workflows/benchmarks.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ on:
44
push:
55
branches: [ main ]
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
sdk-benchmarks:
12+
permissions:
13+
contents: write # required for pushing to gh-pages
914
runs-on: equinix-bare-metal
1015
steps:
1116
- name: Checkout Core Repo @ SHA - ${{ github.sha }}

.github/workflows/changelog.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
branches:
1111
- main
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
changelog:
1518
runs-on: ubuntu-latest

.github/workflows/check-links.yml

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

7+
permissions:
8+
contents: read
9+
710
jobs:
811
changedfiles:
912
name: changed files

.github/workflows/codeql-analysis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ on:
1414
# * * * * *
1515
- cron: '30 1 * * *'
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
CodeQL-Build:
22+
permissions:
23+
security-events: write # for github/codeql-action/analyze to upload SARIF results
1924
runs-on: ubuntu-latest
2025

2126
steps:

.github/workflows/contrib.yml

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

9+
permissions:
10+
contents: read
11+
912
concurrency:
1013
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1114
cancel-in-progress: true

.github/workflows/lint_0.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
- 'release/*'
1010
pull_request:
1111

12+
permissions:
13+
contents: read
14+
1215
concurrency:
1316
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1417
cancel-in-progress: true

.github/workflows/misc_0.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
- 'release/*'
1010
pull_request:
1111

12+
permissions:
13+
contents: read
14+
1215
concurrency:
1316
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1417
cancel-in-progress: true

.github/workflows/prepare-patch-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@ name: Prepare patch release
22
on:
33
workflow_dispatch:
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
prepare-patch-release:
10+
permissions:
11+
pull-requests: write # required for adding labels to PRs
712
runs-on: ubuntu-latest
813
steps:
914
- uses: actions/checkout@v4

.github/workflows/prepare-release-branch.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
description: "Pre-release version number? (e.g. 1.9.0rc2)"
77
required: false
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
prereqs:
1114
runs-on: ubuntu-latest
@@ -39,6 +42,8 @@ jobs:
3942
fi
4043
4144
create-pull-request-against-release-branch:
45+
permissions:
46+
pull-requests: write # required for adding labels to PRs
4247
runs-on: ubuntu-latest
4348
needs: prereqs
4449
steps:
@@ -121,6 +126,8 @@ jobs:
121126
gh pr edit ${{ steps.create_release_branch_pr.outputs.pr_url }} --add-label "prepare-release"
122127
123128
create-pull-request-against-main:
129+
permissions:
130+
pull-requests: write # required for adding labels to PRs
124131
runs-on: ubuntu-latest
125132
needs: prereqs
126133
steps:

0 commit comments

Comments
 (0)