Skip to content

Commit 654a144

Browse files
committed
ci: declare workflow-level contents: read on 2 workflows
Pins the default GITHUB_TOKEN to contents: read on workflows that don't call a GitHub API beyond the initial checkout. Drops the autofix.yml change from the earlier revision because that workflow uses autofix-ci to push fixes back to the PR head, which needs write scope (per @JounQin review feedback). Other workflows that need write scopes are left implicit for a maintainer 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, 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 e867680 commit 654a144

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref }}
1111
cancel-in-progress: true
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
ci:
1518
name: Lint and Test on Node ${{ matrix.node }} (ESLint ${{ matrix.eslint }})

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ concurrency:
77
group: ${{ github.workflow }}-${{ github.ref }}
88
cancel-in-progress: true
99

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

0 commit comments

Comments
 (0)