ci: set cache-mode on release workflows - #66
Draft
claude[bot] wants to merge 1 commit into
Draft
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> 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) could read from and write to the GitHub Actions cache. Thereleasejob already opts out ofsetup-node's package-manager cache viapackage-manager-cache: false, but that is a per-step setting, and thetestjob thatrelease.ymlcalls viauses: ./.github/workflows/test.ymlstill restores and saves ayarncache on every release run.After: The Release workflow declares
cache-mode: noneat the top level, so no job in a release run can read or write the Actions cache, including the reusabletestjob it calls (the caller'snonecaps the called workflow's cache access during release runs). Any step that tries to use the cache logs a message and continues: a skipped restore behaves like a cache miss and a skipped save is a no-op, so nothing fails. Pull request and scheduled runs oftest.ymlare unchanged and keep caching.This uses GitHub's new
cache-modeworkflow key (changelog, syntax reference) to enforce that release paths never touch the cache, regardless of per-step settings.How: Adds a one-line comment and
cache-mode: noneto.github/workflows/release.yml, directly after the top-levelpermissions:block. The existingpackage-manager-cache: falseline is left in place. No other files are touched.Note that PR CI does not exercise the Release workflow, so the first release after this merges is the real test. Because a denied cache step logs and continues rather than failing, the expected outcome is a normal release with cache restore/save steps reported as skipped. For reference, actionlint v1.7.12 does not yet know the
cache-modekey and flags it as an unexpected workflow key; zizmor 1.30.1 parses the file without complaint (this repo does not run either tool in CI).🤖 Generated with Claude Code
https://claude.ai/code/session_01MYe3WCXtgiqomNuVQdi4Yd
Generated by Claude Code