Skip to content

Commit 312d176

Browse files
authored
ci: declare workflow-level contents: read on 5 workflows (#1066)
ci: declare workflow-level contents: read on 5 workflows Pins the default GITHUB_TOKEN to contents: read on the workflows in .github/workflows/ that don't call a GitHub API beyond the initial checkout. The other workflows in this directory are left implicit because they need write scopes that a maintainer is better placed to declare. Motivation: CVE-2025-30066 (March 2025 tj-actions/changed-files compromise) exfiltrated GITHUB_TOKEN from workflow logs. Per-workflow caps bound runtime authority irrespective of repo or org default, give drift protection if the default ever widens, and are credited per-file by the OpenSSF Scorecard Token-Permissions check. YAML validated locally with yaml.safe_load. Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
1 parent 072beb9 commit 312d176

5 files changed

Lines changed: 15 additions & 0 deletions

File tree

.github/workflows/deprecate-package.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ on:
2323
required: true
2424
type: string
2525

26+
permissions:
27+
contents: read
28+
2629
jobs:
2730
deprecate:
2831
name: Deprecate Package

.github/workflows/integration-tests-dev.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ on:
2020
pull_request:
2121
branches: [main]
2222

23+
permissions:
24+
contents: read
25+
2326
jobs:
2427
test:
2528
timeout-minutes: 60

.github/workflows/quality.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
pull_request:
1313
branches: [main]
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
biome:
1720
name: "Biome"

.github/workflows/unit-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
pull_request:
1414
branches: [main]
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
test:
1821
name: 'Test'

.github/workflows/visual-tests-schedule.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ on:
2222
type: string
2323
required: false
2424

25+
permissions:
26+
contents: read
27+
2528
jobs:
2629
test:
2730
timeout-minutes: 60

0 commit comments

Comments
 (0)