You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change hardens the published @docker/actions-toolkit package by making each release include an npm shrinkwrap for its production dependency tree.
The publish workflow now generates a production-only npm lockfile with lifecycle scripts disabled, converts it to npm-shrinkwrap.json, and publishes with provenance as before. The package file allowlist now includes npm-shrinkwrap.json so the generated shrinkwrap is shipped in the npm package.
This addresses the supply-chain concern raised in docker/github-builder#216 (review). Exact npm package versions are immutable, but publishing a shrinkwrap also pins the transitive dependency resolution that consumers get when they install @docker/actions-toolkit.
For action repositories, the better boundary is that each action repo owns its full dependency graph through its committed lockfile and immutable install, then bundles the final action into dist. End users of an action like docker/bake-action don't install @docker/actions-toolkit at runtime, they run the bundled action code.
The concern that triggered this is still valid for docker/github-builder, but that is a different install surface. github-builder currently installs @docker/actions-toolkit dynamically inside the reusable workflow, so its transitive dependency resolution happens at workflow runtime. We should harden that path directly rather than pushing a shrinkwrap onto every library consumer.
The stronger long-term fix for github-builder is probably to stop doing ad hoc runtime npm installs and move the helper logic into a bundled action or another checked, pinned artifact. A short-term hardening path there would be to keep the exact @docker/actions-toolkit version, keep --ignore-scripts, avoid cache-preferred resolution, use --no-save, and consider npm audit signatures after install.
Given that, I put this PR back to draft and handle the github-builder npm install surface separately.
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
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.
This change hardens the published
@docker/actions-toolkitpackage by making each release include an npm shrinkwrap for its production dependency tree.The publish workflow now generates a production-only npm lockfile with lifecycle scripts disabled, converts it to
npm-shrinkwrap.json, and publishes with provenance as before. The package file allowlist now includesnpm-shrinkwrap.jsonso the generated shrinkwrap is shipped in the npm package.This addresses the supply-chain concern raised in docker/github-builder#216 (review). Exact npm package versions are immutable, but publishing a shrinkwrap also pins the transitive dependency resolution that consumers get when they install
@docker/actions-toolkit.More info: https://docs.npmjs.com/cli/v11/configuring-npm/npm-shrinkwrap-json