Skip to content

Commit 32ad838

Browse files
opentelemetrybototelbot[bot]trask
authored
Add minimum token permissions for all github workflow files (open-telemetry#2513)
Co-authored-by: otelbot <[email protected]> Co-authored-by: Trask Stalnaker <[email protected]>
1 parent df18eea commit 32ad838

10 files changed

+38
-1
lines changed

.github/workflows/auto-update-spec-repo-links.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
- cron: "46 * * * *"
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
check-versions:
1013
runs-on: ubuntu-latest
@@ -43,6 +46,8 @@ jobs:
4346
echo "already-opened=$already_opened" >> $GITHUB_OUTPUT
4447
4548
update-spec-repo-links:
49+
permissions:
50+
contents: write # required for pushing changes
4651
runs-on: ubuntu-latest
4752
if: |
4853
needs.check-versions.outputs.current-version != needs.check-versions.outputs.latest-version &&

.github/workflows/build-system-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
- 'dependencies.Dockerfile'
1515
- 'internal/tools/**'
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821

1922
# Ensure that invoking "make" without a specific build target will succeed.

.github/workflows/changelog.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- main
1212
merge_group:
1313

14+
permissions:
15+
contents: read
16+
1417
concurrency:
1518
group: ${{ github.workflow }}-${{ github.head_ref }}
1619
cancel-in-progress: true

.github/workflows/checks.yml

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

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
markdownlint:
1215
runs-on: ubuntu-latest

.github/workflows/daily-link-check.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ on:
88

99
permissions:
1010
contents: read
11-
issues: write
1211

1312
jobs:
1413
link-check:
1514
uses: ./.github/workflows/reusable-link-check.yml
1615

1716
workflow-notification:
17+
permissions: # required by the reusable workflow
18+
contents: read
19+
issues: write
1820
needs:
1921
- link-check
2022
if: always()

.github/workflows/generate-registry-area-labels.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ on:
1010

1111
workflow_dispatch:
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
generate-component-labels:
18+
permissions:
19+
issues: write # required for labeling PRs
1520
runs-on: ubuntu-latest
1621
if: ${{ github.repository_owner == 'open-telemetry' }}
1722
steps:

.github/workflows/prepare-new-issue.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ on:
33
issues:
44
types: [opened]
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
prepare-new-issue:
11+
permissions:
12+
issues: write # required for labeling issues
813
runs-on: ubuntu-latest
914
if: ${{ github.repository_owner == 'open-telemetry' }}
1015
steps:

.github/workflows/prepare-new-pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches: [ 'main*' ]
66
paths: ['.chloggen/*']
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
prepare-new-pr:
1013
runs-on: ubuntu-latest

.github/workflows/prepare-release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
description: 'The version to release, e.g. 1.30.0'
77
required: true
88

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

.github/workflows/stale-pr.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ on:
33
schedule:
44
- cron: "12 3 * * *" # arbitrary time not to DDOS GitHub
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
stale:
11+
permissions:
12+
pull-requests: write # required for closing stale PRs
813
runs-on: ubuntu-latest
914
steps:
1015
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0

0 commit comments

Comments
 (0)