Skip to content

Commit 0ea2e7f

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. 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 23209ff commit 0ea2e7f

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

.github/workflows/format-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
- synchronize
1414
workflow_dispatch:
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
format-check:
1821
name: Run format check

.github/workflows/static-analysis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
- synchronize
1313
workflow_dispatch:
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
1619

1720
static-analysis:

0 commit comments

Comments
 (0)