Skip to content

Commit f9c72b2

Browse files
committed
ci: declare workflow-level contents: read on 4 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 6013996 commit f9c72b2

4 files changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/license-header-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ on:
1919
pull_request:
2020
types: [opened, synchronize, reopened]
2121

22+
permissions:
23+
contents: read
24+
2225
jobs:
2326
license-header-check:
2427
runs-on: ubuntu-latest

.github/workflows/markdown-links-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ on:
1919
pull_request:
2020
types: [opened, synchronize, reopened]
2121

22+
permissions:
23+
contents: read
24+
2225
jobs:
2326
markdown-link-check:
2427
runs-on: ubuntu-latest

.github/workflows/mvn-verify-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ env:
3535
-Daether.connector.http.connectionMaxTtl=30
3636
-Drapids.secondaryCacheDir=$HOME/.m2/repository/.sbt/1.0/zinc/org.scala-sbt
3737
38+
permissions:
39+
contents: read
40+
3841
jobs:
3942
cache-dependencies:
4043
runs-on: ubuntu-latest

.github/workflows/shell-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ on:
1919
pull_request:
2020
types: [opened, synchronize, reopened]
2121

22+
permissions:
23+
contents: read
24+
2225
jobs:
2326
shell-check:
2427
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)