Skip to content

Commit fbad8e7

Browse files
committed
ci: declare workflow-level contents: read on 3 workflows
Pins the default GITHUB_TOKEN to contents: read on the workflows in .github/workflows/ that don't call a GitHub API beyond the initial checkout. The other workflows in this directory are left implicit because they need write scopes that a maintainer is better placed 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 if the default ever widens, 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 9f5ac25 commit fbad8e7

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/merge_group.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ name: Merge Queue
55
on:
66
merge_group:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
call-core:
1013
uses: ./.github/workflows/suite_core.yml

.github/workflows/pypi_build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ on:
2525
env:
2626
TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }}
2727

28+
permissions:
29+
contents: read
30+
2831
jobs:
2932
pypi-build:
3033
runs-on: ubuntu-latest

.github/workflows/test_hosted.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ on:
77
description: 'SHA to test (optional)'
88
required: false
99
type: string
10-
10+
11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
explore-linux:
1316
runs-on: linux-x86-n2-16

0 commit comments

Comments
 (0)