From 54222cc606c1cb673060287ffc454a4a35dbb64e Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 17 Sep 2026 00:07:06 +0000 Subject: [PATCH] ci: restrict GitHub Actions cache access with cache-mode Set cache-mode to none at the workflow level, as none of the jobs restores or saves a cache, and document the convention next to the permissions rule. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01AKZPpJJVhgvmm2GZbX3nxV --- .github/workflows/ci.yml | 1 + .github/workflows/release.yml | 1 + .github/workflows/update-material.yml | 1 + AGENTS.md | 3 +++ 4 files changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2678470..83338cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,7 @@ on: workflow_dispatch: permissions: {} +cache-mode: none concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ce614e..9174a97 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,6 +9,7 @@ on: workflow_dispatch: permissions: {} +cache-mode: none concurrency: group: ${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && 'release' || github.ref }} diff --git a/.github/workflows/update-material.yml b/.github/workflows/update-material.yml index 064c045..4dcdeae 100644 --- a/.github/workflows/update-material.yml +++ b/.github/workflows/update-material.yml @@ -10,6 +10,7 @@ on: workflow_dispatch: permissions: {} +cache-mode: none concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/AGENTS.md b/AGENTS.md index 8cfecaa..900a97e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -38,4 +38,7 @@ This repository publishes dev container features for use with the [Dev Container e.g. `uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0`. - Set workflow-level permissions to empty (`permissions: {}`) and grant the minimum required permissions per job. +- Set workflow-level cache access to none (`cache-mode: none`) and grant + the minimum required mode per job: `read` when a job only restores + caches, `write` when it also saves ones later runs restore. - Set `persist-credentials: false` on `actions/checkout`.