From 52f4a997635ca26ba6d29587a69f26e558a80eba Mon Sep 17 00:00:00 2001 From: Arpit Jain Date: Fri, 15 May 2026 14:48:35 +0900 Subject: [PATCH] ci: declare workflow-level contents: read on 5 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/deprecate-package.yml | 3 +++ .github/workflows/integration-tests-dev.yml | 3 +++ .github/workflows/quality.yml | 3 +++ .github/workflows/unit-tests.yml | 3 +++ .github/workflows/visual-tests-schedule.yml | 3 +++ 5 files changed, 15 insertions(+) diff --git a/.github/workflows/deprecate-package.yml b/.github/workflows/deprecate-package.yml index cfb5baeb1..88539008e 100644 --- a/.github/workflows/deprecate-package.yml +++ b/.github/workflows/deprecate-package.yml @@ -23,6 +23,9 @@ on: required: true type: string +permissions: + contents: read + jobs: deprecate: name: Deprecate Package diff --git a/.github/workflows/integration-tests-dev.yml b/.github/workflows/integration-tests-dev.yml index d2a076761..283f7c840 100644 --- a/.github/workflows/integration-tests-dev.yml +++ b/.github/workflows/integration-tests-dev.yml @@ -20,6 +20,9 @@ on: pull_request: branches: [main] +permissions: + contents: read + jobs: test: timeout-minutes: 60 diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index e355749a0..5c1aabfd1 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -12,6 +12,9 @@ on: pull_request: branches: [main] +permissions: + contents: read + jobs: biome: name: "Biome" diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 943820a6c..f67718bc7 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -13,6 +13,9 @@ on: pull_request: branches: [main] +permissions: + contents: read + jobs: test: name: 'Test' diff --git a/.github/workflows/visual-tests-schedule.yml b/.github/workflows/visual-tests-schedule.yml index 57f38079d..96fdbc642 100644 --- a/.github/workflows/visual-tests-schedule.yml +++ b/.github/workflows/visual-tests-schedule.yml @@ -22,6 +22,9 @@ on: type: string required: false +permissions: + contents: read + jobs: test: timeout-minutes: 60