Skip to content

Commit bca4826

Browse files
Add minimum token permissions for all github workflow files (#3604)
1 parent c30b8fa commit bca4826

20 files changed

+86
-0
lines changed

.github/workflows/backport.yml

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

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
backport:
14+
permissions:
15+
contents: write # required for pushing branches
16+
pull-requests: write # required for creating pull requests
1117
runs-on: ubuntu-latest
1218
steps:
1319
- run: |

.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/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/component-owners.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ name: 'Component Owners'
66
on:
77
pull_request_target:
88

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

.github/workflows/core_contrib_test_0.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
required: true
1414
type: string
1515

16+
permissions:
17+
contents: read
18+
1619
env:
1720
CORE_REPO_SHA: ${{ inputs.CORE_REPO_SHA }}
1821
CONTRIB_REPO_SHA: ${{ inputs.CONTRIB_REPO_SHA }}

.github/workflows/generate_workflows_lib/src/generate_workflows_lib/core_contrib_test.yml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
required: true
1414
type: string
1515

16+
permissions:
17+
contents: read
18+
1619
env:
1720
CORE_REPO_SHA: ${% raw %}{{ inputs.CORE_REPO_SHA }}{% endraw %}
1821
CONTRIB_REPO_SHA: ${% raw %}{{ inputs.CONTRIB_REPO_SHA }}{% endraw %}

.github/workflows/generate_workflows_lib/src/generate_workflows_lib/lint.yml.j2

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: ${% raw %}{{ github.workflow }}-${{ github.head_ref || github.run_id }}{% endraw %}
1417
cancel-in-progress: true

.github/workflows/generate_workflows_lib/src/generate_workflows_lib/misc.yml.j2

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: ${% raw %}{{ github.workflow }}-${{ github.head_ref || github.run_id }}{% endraw %}
1417
cancel-in-progress: true

.github/workflows/generate_workflows_lib/src/generate_workflows_lib/test.yml.j2

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: ${% raw %}{{ github.workflow }}-${{ github.head_ref || github.run_id }}{% endraw %}
1417
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

0 commit comments

Comments
 (0)