Skip to content

feat: allow setup-environment to skip the dependency cache - #192

Open
ovflowd wants to merge 1 commit into
mainfrom
setup-environment-cache
Open

ovflowd wants to merge 1 commit into
mainfrom
setup-environment-cache

Conversation

@ovflowd

@ovflowd ovflowd commented Oct 25, 2026

Copy link
Copy Markdown
Member

This PR adds a cache input to setup-environment. It defaults to true, so nothing changes for current callers, and false turns off both setup-node's cache and its automatic package-manager-cache.

Jobs that publish (and hold id-token: write) shouldn't restore a pnpm/npm store that another workflow could have poisoned, which is what zizmor's cache-poisoning audit flags. Once this lands, doc-kit's publish job will pass cache: false instead of inlining these steps, as discussed in nodejs/doc-kit#1178.

cc @MattIPv4

Add a `cache` input (default `true`, so nothing changes for existing
callers). Release jobs can pass `cache: false` so they never restore a
pnpm/npm store that another workflow could have poisoned, which zizmor
flags as `cache-poisoning` in publishing workflows. `false` also turns
off setup-node's automatic `package-manager-cache`.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@ovflowd
ovflowd requested a review from a team as a code owner October 25, 2026 16:46
Copilot AI balanced review requested due to automatic review settings October 25, 2026 16:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Both setup paths consistently disable caching when requested, preserve existing defaults, and have no unresolved findings.

No open issues 🎉

What changed in this PR

Adds an optional dependency-cache opt-out to the shared setup-environment action for publishing and other sensitive jobs, while preserving caching by default.

Changes:

  • Introduces a cache input defaulting to "true".
  • Disables explicit and automatic package-manager caching when opted out, in both Node.js setup paths.
File Description
actions/​setup-environment/​action.yml Adds the cache input and applies it to both Node.js setup steps.

Review effort: Balanced

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.

3 participants