Repository navigation
harden npm install in publish.yml - #1442
Closed
blakedeckard wants to merge 2 commits into
Closed
blakedeckard wants to merge 2 commits into
blakedeckard wants to merge 2 commits into
Conversation
Member
|
Thanks for digging into this and putting the PR together. The extra protections make sense for the separate npm resolution. I'll take it from here and also move runtime preparation before either publish, so a resolution failure doesn't leave us with only the toolkit published. |
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.
was reviewing the CI for anything unpinned with Claude, and came across this npm shrinkwrap generation. it seems quite difficult to match the yarn-lock and what gets published, but that might be an eventual goal. i'm not as familiar with yarn as npm, so i decided to just propose some changes that might help with the npm side in the meantime.
.yarnrc.ymlcurrently setsnpmMinimalAgeGate: 2d, while the npm install that resolves what goes into the shrinkwrap does not have any cooldown. adding--min-release-age=2[0] should allow the shrinkwrap to reflect this same cooldown. it will NOT guarantee that what is pushed matches the yarn lock--allow-git=none[1] blocks git dependencies, direct or transitive. this closes a code-execution path where a git dependency’s.npmrccould override the git executable even with--ignore-scripts[3]. if I understand properly, git dependencies also aren’t covered bymin-release-age.--allow-remote=none[2] blocks dependencies resolved from tarball URLs rather than the registry. if I understand properly, these also aren’t covered bymin-release-age, since they aren’t registry publishes.in npm v12
allow-gitandallow-remotedefault to none, so this should only surface issues that could come from an eventual migration to npm v12 [3]the risk of this change is that
@docker/actions-toolkitis published on line 76, so if this causes any breaks, this would leave a half-published release where@docker/actions-toolkitwas pushed and@docker/github-builder-runtimeis not.[0] https://docs.npmjs.com/cli/v11/using-npm/config#min-release-age
[1] https://docs.npmjs.com/cli/v11/using-npm/config#allow-git
[2] https://docs.npmjs.com/cli/v11/using-npm/config#allow-remote
[3] https://github.blog/changelog/2026-06-09-upcoming-breaking-changes-for-npm-v12/
I used Claude to help research the npm/Yarn behavior, review this change, and edit the above prose; I’ve read through the linked sources myself. I was familiar with
min-release-ageandallow-git, but it also suggestedallow-remote, which was new to me.