From 4a20191fcc8440f1265f50920b3b11005a582c92 Mon Sep 17 00:00:00 2001 From: Arpit Jain Date: Fri, 15 May 2026 14:49:40 +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/docstests.yml | 3 +++ .github/workflows/lint.yml | 4 ++++ .github/workflows/nodetests.yml | 4 ++++ .github/workflows/pythontests.yml | 4 ++++ 4 files changed, 15 insertions(+) diff --git a/.github/workflows/docstests.yml b/.github/workflows/docstests.yml index 829d57b07..25ff0106f 100644 --- a/.github/workflows/docstests.yml +++ b/.github/workflows/docstests.yml @@ -10,6 +10,9 @@ on: paths: - 'docs_website/**/*' +permissions: + contents: read + jobs: test-docs-build: name: Test Docs Build diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e00e432a5..218700fa5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,6 +4,10 @@ on: branches: - master pull_request: + +permissions: + contents: read + jobs: lint: runs-on: ubuntu-latest diff --git a/.github/workflows/nodetests.yml b/.github/workflows/nodetests.yml index 665e16c16..6c8ba89e9 100644 --- a/.github/workflows/nodetests.yml +++ b/.github/workflows/nodetests.yml @@ -16,6 +16,10 @@ on: - 'querybook/**/*.s?css' - 'querybook/**/*.html' - 'package.json' + +permissions: + contents: read + jobs: nodetests: runs-on: ubuntu-latest diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml index 80e3f29b4..aa9eeb54d 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -10,6 +10,10 @@ on: paths: - '**.py' - 'requirements/**/*.txt' + +permissions: + contents: read + jobs: pythontests: runs-on: ubuntu-latest