Skip to content

Commit ce06074

Browse files
committed
ci: declare workflow-level contents: read on 6 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 aa9c6fd commit ce06074

6 files changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/validate-android.yml

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

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
build:
1316
name: Build [${{ matrix.os }}][${{ matrix.mode }}]

.github/workflows/validate-cpp.yml

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

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
test:
1619
name: Build and Test [${{ matrix.toolchain }}][${{ matrix.mode }}]

.github/workflows/validate-js.yml

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

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
benchmark:
1619
name: Benchmark [${{ matrix.os }}]

.github/workflows/validate-swiftpm.yml

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

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
test:
1316
name: Build

.github/workflows/validate-tests.yml

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

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
validate:
1215
name: Validate

.github/workflows/validate-website.yml

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

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
build_next:
1417
name: Build

0 commit comments

Comments
 (0)