Skip to content

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

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, pr-title.yml and release.yml. No job restores or saves a cache: actions/setup-node caches nothing unless its cache input is set, and the Dev Containers CLI and devcontainers/action use no Actions cache, so nothing needs a job-level grant.

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: setup-node caches nothing unless its cache
input is set, and the Dev Containers CLI uses no Actions cache.

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:09
@nozaq
nozaq merged commit fb7afee into main Sep 17, 2026
75 checks passed
@nozaq
nozaq deleted the claude/gha-workflow-minimal-permissions-1mgnnz branch September 17, 2026 01:09
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