Skip to content

Commit 37faa67

Browse files
authored
Limit GH Actions Token Permissions (#14333)
1 parent 6cd8082 commit 37faa67

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.github/workflows/ci-markdown.yml

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

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
lint:
1922
name: Lint Markdown content

.github/workflows/release.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ env:
1616
LANG: C.UTF-8
1717

1818
permissions:
19-
contents: write
20-
id-token: write
21-
attestations: write
19+
contents: read
2220

2321
jobs:
2422
create_draft_release:
2523
runs-on: ubuntu-22.04
24+
permissions:
25+
contents: write
2626
env:
2727
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2828
steps:
@@ -122,6 +122,9 @@ jobs:
122122

123123
runs-on: ${{ matrix.flavor == 'linux' && 'ubuntu-22.04' || 'windows-2022' }}
124124

125+
permissions:
126+
contents: write
127+
125128
steps:
126129
- name: "Download build"
127130
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
@@ -181,6 +184,11 @@ jobs:
181184

182185
runs-on: ubuntu-24.04
183186

187+
permissions:
188+
contents: write
189+
id-token: write
190+
attestations: write
191+
184192
steps:
185193
- name: Use HTTPS instead of SSH for Git cloning
186194
id: git-config
@@ -255,6 +263,9 @@ jobs:
255263
needs: [create_draft_release, build, sign, sbom]
256264
runs-on: ubuntu-22.04
257265

266+
permissions:
267+
contents: write
268+
258269
steps:
259270
- uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
260271
with:

0 commit comments

Comments
 (0)