Skip to content

ci: restrict GitHub Actions cache access with cache-mode - #40

Merged
nozaq merged 1 commit into
mainfrom
claude/gha-workflow-minimal-permissions-1mgnnz
Sep 17, 2026
Merged

nozaq merged 1 commit into
mainfrom
claude/gha-workflow-minimal-permissions-1mgnnz

Conversation

@nozaq

@nozaq nozaq commented Sep 17, 2026

Copy link
Copy Markdown
Member

Summary

GitHub now lets a workflow or job declare the cache access it needs with cache-mode (read, write, write-only, none), enforced by the cache service (changelog, workflow syntax, dependency caching reference). Without it, push, schedule and workflow_dispatch runs get write by default.

This applies the same least-privilege pattern already used for permissions:

  • cache-mode: none at the workflow level of ci.yml, release.yml and update-material.yml. No job restores or saves a cache: the Dev Containers CLI is installed with npm install --global and devcontainers/action uses no Actions cache, so nothing needs a job-level grant.
  • AGENTS.md documents the convention next to the permissions: {} rule.

Notes

  • A cache operation refused by the mode is logged and the step continues, so a job that turns out to need the cache slows down rather than fails.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKZPpJJVhgvmm2GZbX3nxV


Generated by Claude Code

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKZPpJJVhgvmm2GZbX3nxV
@nozaq
nozaq marked this pull request as ready for review September 17, 2026 01:14
@nozaq
nozaq merged commit 1a0b007 into main Sep 17, 2026
9 checks passed
@nozaq
nozaq deleted the claude/gha-workflow-minimal-permissions-1mgnnz branch September 17, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants