From 98d6a4ca3bff95993113301552895b0fe65490f2 Mon Sep 17 00:00:00 2001 From: Arpit Jain Date: Fri, 15 May 2026 15:59:42 +0900 Subject: [PATCH] ci: declare workflow-level contents: read on 2 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/edenscm-libs.yml | 3 +++ .github/workflows/sapling-addons.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/edenscm-libs.yml b/.github/workflows/edenscm-libs.yml index 9f46c61cb67f5..1bd761dd59104 100644 --- a/.github/workflows/edenscm-libs.yml +++ b/.github/workflows/edenscm-libs.yml @@ -3,6 +3,9 @@ name: EdenSCM Rust Libraries on: workflow_dispatch +permissions: + contents: read + jobs: build: diff --git a/.github/workflows/sapling-addons.yml b/.github/workflows/sapling-addons.yml index bf2c0f0e5843b..3f4109f3ee2b1 100644 --- a/.github/workflows/sapling-addons.yml +++ b/.github/workflows/sapling-addons.yml @@ -5,6 +5,9 @@ env: on: public +permissions: + contents: read + jobs: verify-addons: runs-on: ubuntu-latest