ci: set cache-mode on release workflows - #469
Draft
claude[bot] wants to merge 1 commit into
Draft
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by David Sanders · Slack thread
Before: A release run (push to
main) or a docs-publish run (push of av*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 viapackage-manager-cache: false, but that protection lives in each step's inputs and silently disappears if a step is added or changed. Thetestjob thatrelease.ymlcalls viauses:runs with whatever cache accesstest.ymlrequests.After: Both
release.ymlanddocs.ymldeclarecache-mode: noneat the workflow level, so no job or step in those runs can read or write the Actions cache, whatever the individual steps say. Becauserelease.ymlcallstest.ymlviauses:, the caller'snonealso caps the called test jobs during release runs; the sametest.ymlkeeps its normal caching when it runs for pull requests. The existingpackage-manager-cache: falselines are left in place.GitHub now offers a workflow-level
cache-modekey 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 thepermissions:block in.github/workflows/release.ymland.github/workflows/docs.yml. Nothing else changes;test.ymlis 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/cacheand the@actions/cachetoolkit 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