Skip to content

Commit bb873b0

Browse files
arpitjain099meta-codesync[bot]
authored andcommitted
ci: declare workflow-level contents: read on 6 workflows (#1960)
Summary: Pins the default `GITHUB_TOKEN` to `contents: read` on 6 workflows in `.github/workflows/` that don't call a GitHub API beyond the initial checkout. ## Why CVE-2025-30066 (March 2025 `tj-actions/changed-files` supply-chain compromise) exfiltrated `GITHUB_TOKEN` from workflow logs. Pinning per workflow caps runtime authority irrespective of the repo or org default, gives drift protection if the default ever widens, and is credited per-file by the OpenSSF Scorecard `Token-Permissions` check. YAML validated locally with `yaml.safe_load` on each touched file. Pull Request resolved: #1960 Reviewed By: cortinico Differential Revision: D105338326 Pulled By: CalixTang fbshipit-source-id: e2b71c4db5c48a6161ceefdfbd65f5d58d067474
1 parent 2c48fef commit bb873b0

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)