docs: Update caching recommendations to mitigate cache poisoning risks#1567
Open
chiranjib-swain wants to merge 1 commit into
Open
docs: Update caching recommendations to mitigate cache poisoning risks#1567chiranjib-swain wants to merge 1 commit into
chiranjib-swain wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates docs/advanced-usage.md to strengthen and clarify guidance around npm publishing workflows, specifically to reduce the risk of cache poisoning by disabling setup-node’s automatic npm caching in publishing examples.
Changes:
- Standardizes a “Note” formatting instance for consistency.
- Disables automatic npm caching (
package-manager-cache: false) in npm publishing workflow examples. - Adds a security note explaining why disabling automatic npm caching is recommended in publishing workflows.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| You must also configure a **Trusted Publisher** in npm for your package/scope that matches your GitHub repository and workflow (and optional environment, if used). | ||
|
|
||
| > **Note**: Set `package-manager-cache: false` in publishing workflows because automatic npm caching can activate even without the `cache:` input, and a poisoned cache may expose credentials (including OIDC tokens) to attacker-controlled code. |
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.
Description:
This pull request updates the documentation in
docs/advanced-usage.mdto clarify and improve guidance around npm package publishing workflows, especially regarding dependency caching. The most important changes focus on reducing security risks by disabling automatic npm dependency caching and providing clear notes about its implications.Security and caching improvements:
package-manager-cache: falseto all relevantsetup-nodesteps to explicitly disable automatic npm dependency caching and reduce the risk of cache poisoning, which could expose sensitive credentials.Documentation formatting and clarity:
Related issue:
#1445
Check list: