Skip to content

Commit 418aeef

Browse files
committed
ci: declare workflow-level contents: read on 3 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 b33e660 commit 418aeef

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎.github/workflows/check-links-periodic.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
schedule:
1111
- cron: "0 0,12 * * *"
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
markdown-link-check:
1518
runs-on: ubuntu-latest

‎.github/workflows/check-links-pr.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
on: [pull_request]
22
name: Check Markdown links in modified files
3+
4+
permissions:
5+
contents: read
6+
37
jobs:
48
markdown-link-check:
59
runs-on: ubuntu-latest

‎.github/workflows/test.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches: [main]
66
pull_request:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
pytest:
1013
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)