From fbe4a7323fe5cf65dcd7e15996821312af6fa400 Mon Sep 17 00:00:00 2001 From: Arpit Jain Date: Fri, 15 May 2026 14:49:59 +0900 Subject: [PATCH] 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 --- .github/workflows/beta-docs.yaml | 3 +++ .github/workflows/nightly.yaml | 3 +++ .github/workflows/prod-docs.yaml | 3 +++ .github/workflows/weekly-chromatic.yml | 3 +++ 4 files changed, 12 insertions(+) diff --git a/.github/workflows/beta-docs.yaml b/.github/workflows/beta-docs.yaml index 5ecf301ef2c..ee7045a0ce0 100644 --- a/.github/workflows/beta-docs.yaml +++ b/.github/workflows/beta-docs.yaml @@ -4,6 +4,9 @@ on: types: [published] workflow_dispatch: +permissions: + contents: read + jobs: trigger-circleci: runs-on: ubuntu-latest diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index d8693d83060..1f07c61b253 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -1,6 +1,9 @@ name: Manual nightly deploy on: workflow_dispatch +permissions: + contents: read + jobs: trigger-circleci: runs-on: ubuntu-latest diff --git a/.github/workflows/prod-docs.yaml b/.github/workflows/prod-docs.yaml index c20ba5738b1..b679d5644b7 100644 --- a/.github/workflows/prod-docs.yaml +++ b/.github/workflows/prod-docs.yaml @@ -4,6 +4,9 @@ on: types: [published] workflow_dispatch: +permissions: + contents: read + jobs: trigger-circleci: runs-on: ubuntu-latest diff --git a/.github/workflows/weekly-chromatic.yml b/.github/workflows/weekly-chromatic.yml index 9796932604f..dc1de4ac17c 100644 --- a/.github/workflows/weekly-chromatic.yml +++ b/.github/workflows/weekly-chromatic.yml @@ -5,6 +5,9 @@ on: - cron: '0 17 * * 1' # Monday 9am PST / 10am PDT (GH Actions cron is UTC) workflow_dispatch: # manual trigger for testing +permissions: + contents: read + jobs: chromatic: runs-on: ubuntu-latest