GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Explicitly disable caches in sensitive publish workflows by slorber · Pull Request #1549 · actions/setup-node

Conversation

@slorber

@slorber slorber commented May 14, 2026

Copy link
Copy Markdown

Description:

Sensitive workflows like the Trusted Publishing workflow should explicitly disable cache to reduce supply chain risk due to cache poisoning. See recent hack: https://tanstack.com/blog/npm-supply-chain-compromise-postmortem

It would be better if that default was applied automatically, and not depending on various conditions that are not so easy to understand, so explicitly disabling this in the documentation is safer for now.

Automatic caching was afaik turned on by default in v5 in certain conditions. I think it's worth considering reverting that change and making caching opt-in, to have a more secure action by default, even if it's less performant.

Note that many people upgrade actions without looking at the changelog, using Dependabot. Default value changes like this can introduce vulnerabilities, so whatever the default is, explicitly disabling the cache for sensitive workflows remains a good idea IMHO.

Note that on README.md, there's already a disclaimer giving similar advice. However it's not easy to find and your Trusted Publishing docs don't even follow that recommendation:

CleanShot 2026-05-14 at 11 10 25@2x

https://github.com/actions/setup-node#breaking-changes-in-v5

I believe all your documented examples should follow that recommendation, explicitly disable caching with package-manager-cache: false, and link to a canonical doc page explaining the security problem.

This PR is just to kickstart the discussion; there are probably other sensitive workflows you document that do not have package-manager-cache: false, and probably other official GitHub Actions whose docs show insecure examples.

Related issue:

See my comment here: #1445 (comment)

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@slorber
Explicitly disable caches in sensitive publish workflows
487a302
Copilot AI review requested due to automatic review settings May 14, 2026 09:14
@slorber
slorber requested a review from a team as a code owner May 14, 2026 09:14
Copilot started reviewing on behalf of slorber May 14, 2026 09:14
View session
Copilot AI reviewed May 14, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Pull request overview

Updates published workflow documentation to explicitly disable automatic dependency caching in sensitive publish scenarios (including npm Trusted Publisher/OIDC) to reduce cache-poisoning supply-chain risk.

Changes:

  • Added package-manager-cache: false to npm publish examples (npmjs + GitHub Packages).
  • Added package-manager-cache: false to yarn publish examples.
  • Added package-manager-cache: false to the Trusted Publisher (OIDC) publish example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread docs/advanced-usage.md
Comment on lines 402 to 406
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
package-manager-cache: false # Prevent cache poisoning issues
- run: npm ci
- run: npm publish
Comment thread docs/advanced-usage.md
Comment on lines 507 to 512
- uses: actions/setup-node@v6
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
package-manager-cache: false # Prevent cache poisoning issues

This was referenced May 14, 2026
Trusted Publisher documentation #1445
Closed
Enhance caching in setup-node with automatic package manager detection #1348
Merged
Cache/save should not run automatically from a pull_request_trigger actions/cache#1756
Open
Don't cache automatically in privileged workflows #1358
Closed
@son-oz son-oz mentioned this pull request May 21, 2026
Remove cache in publish workflow OpenZeppelin/compact-tools#93
Merged
@v-chiranjib-swain

v-chiranjib-swain commented Jul 15, 2026

Copy link
Copy Markdown

Closing this PR as superseded by #1567.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@v-chiranjib-swain v-chiranjib-swain closed this Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@slorber @v-chiranjib-swain
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.