Skip to content

Commit a7777bb

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 14b032b commit a7777bb

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/test-long-all.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
schedule:
55
- cron: "0 11 * * *" # 11 UTC, everyday
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
build:
912
name: ${{ matrix.os }} ${{ matrix.version }} ${{ matrix.go }}

.github/workflows/test-long.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Long Tests
22

33
on: [push]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
build:
710
name: ${{ matrix.os }} ${{ matrix.version }} ${{ matrix.go }}

.github/workflows/test-smoke.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Smoke Tests
22

33
on: [pull_request]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
build:
710
name: ${{ matrix.os }} ${{ matrix.version }}

0 commit comments

Comments
 (0)