Skip to content

ci: set cache-mode on release workflows - #469

Draft
claude[bot] wants to merge 1 commit into
mainfrom
ci/cache-mode
Draft

ci: set cache-mode on release workflows#469
claude[bot] wants to merge 1 commit into
mainfrom
ci/cache-mode

Conversation

@claude

@claude claude Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Requested by David Sanders · Slack thread

Before: A release run (push to main) or a docs-publish run (push of a v* tag) could restore from or save to the GitHub Actions cache if any step asked for it. Today the release jobs opt out per step via package-manager-cache: false, but that protection lives in each step's inputs and silently disappears if a step is added or changed. The test job that release.yml calls via uses: runs with whatever cache access test.yml requests.

After: Both release.yml and docs.yml declare cache-mode: none at the workflow level, so no job or step in those runs can read or write the Actions cache, whatever the individual steps say. Because release.yml calls test.yml via uses:, the caller's none also caps the called test jobs during release runs; the same test.yml keeps its normal caching when it runs for pull requests. The existing package-manager-cache: false lines are left in place.

GitHub now offers a workflow-level cache-mode key that enforces this at the runner rather than per step, so release paths are guaranteed never to consume a cache entry a PR run could have poisoned; see the changelog and the workflow syntax reference.

How: Adds a top-level cache-mode: none (with a one-line comment) directly after the permissions: block in .github/workflows/release.yml and .github/workflows/docs.yml. Nothing else changes; test.yml is untouched so PR CI keeps caching.

Note that PR CI does not exercise the release or docs workflows, so the first release (and first tag push) after merge is the real test. If a step is denied cache access under this mode, actions/cache and the @actions/cache toolkit log a message and continue (a skipped restore behaves as a cache miss, a skipped save is a no-op), so the run does not fail.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MYe3WCXtgiqomNuVQdi4Yd


Generated by Claude Code

Add top-level `cache-mode: none` to the release and docs-publish
workflows so nothing in a release run can restore from or save to the
GitHub Actions cache, regardless of per-step settings.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MYe3WCXtgiqomNuVQdi4Yd
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.

1 participant