From 70e8a4059a38be9806ba2e95dd54aa2ba5880bed Mon Sep 17 00:00:00 2001 From: Arpit Jain Date: Fri, 15 May 2026 15:06:59 +0900 Subject: [PATCH] ci: declare workflow-level contents: read on 3 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/nightly.yml | 3 +++ .github/workflows/run_examples.yml | 2 ++ .github/workflows/test_head.yml | 3 +++ 3 files changed, 8 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1846891dd..622871d40 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -15,6 +15,9 @@ env: # CHC_VERSION: "0.9.0" CH_VERSION: "25.3" +permissions: + contents: read + jobs: nightly: if: ${{ startsWith(github.repository, 'ClickHouse/') }} diff --git a/.github/workflows/run_examples.yml b/.github/workflows/run_examples.yml index e67a3a473..d4833407a 100644 --- a/.github/workflows/run_examples.yml +++ b/.github/workflows/run_examples.yml @@ -22,6 +22,8 @@ concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.number || github.sha }} cancel-in-progress: true +permissions: + contents: read jobs: run-examples-with-8-jdk-and-latest: diff --git a/.github/workflows/test_head.yml b/.github/workflows/test_head.yml index f1129021b..e343d4dc0 100644 --- a/.github/workflows/test_head.yml +++ b/.github/workflows/test_head.yml @@ -19,6 +19,9 @@ concurrency: env: CH_VERSION: "head" +permissions: + contents: read + jobs: test-java-client: runs-on: ubuntu-latest