Repository navigation
ci: set cache-mode on release workflows - #469
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MYe3WCXtgiqomNuVQdi4Yd
There was a problem hiding this comment.
I reviewed this PR and didn't find any bugs via the standard checks. Because the whole change hinges on a workflow-level cache-mode: none key that I cannot confirm is part of the documented GitHub Actions workflow schema, a human should verify that key is actually recognized before relying on it (release paths are the second affected feature here, so an unrecognized key either makes the stated protection a no-op or, if GitHub's schema validator rejects unknown top-level keys, could break these workflows outright).
What was reviewed: the two added blocks (comment + cache-mode: none) in docs.yml and release.yml, their placement right after permissions: {}, and that nothing else in either workflow (jobs, steps, the existing package-manager-cache: false lines, the uses: test.yml call) was touched.
Extended reasoning...
The diff adds an identical 2-line block (a comment plus cache-mode: none) to the top level of both .github/workflows/docs.yml and .github/workflows/release.yml, right after permissions: {}; nothing else changes, and no job/step logic is touched, so there is no injection, auth, or permissions-elevation surface here. The deciding fact for defer is that cache-mode does not match any top-level GitHub Actions workflow key I'm aware of (name, on, permissions, env, defaults, concurrency, jobs, etc.), and the PR's entire stated purpose — guaranteeing release/docs runs can never touch the Actions cache — depends on GitHub actually supporting this key; a human with current access to GitHub's live schema/docs should confirm it before trusting the comment's claim or merging further workflow changes on top of it. A maintainer already approved this PR, but that doesn't by itself establish the key was fact-checked, so flagging it is still useful.
|
Confirming the reviewer's open question: As noted in the description, PR CI does not run Generated by Claude Code |
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