Introducing a new way to review your PRs.

Read the announcement

pnpm / action-setup

Install pnpm package manager

View on GitHub

12 documents · Updated Nov 6, 2026

docs / embedded-bootstrap-artifacts

Embedded pnpm bootstrap artifacts

The embedded bootstrap artifacts give the action a trusted starting point for installing pnpm. They pin the package data used for the first install, while the maintenance script refreshes that data when a bootstrap version changes. This page complements Action packaging and maintenance and relates to Continuous validation and pnpm provisioning.

Bootstrap artifact role

The bootstrap lock data lets the action install a known pnpm package before it switches to the version requested by the workflow. This separates the first tool install from the target pnpm version and lets the action support different pnpm major versions and runner Node versions.

The installer chooses one of three committed lock files:

ArtifactBootstrap packageMain use
pnpm-lock.jsonpnpm 11.28.10Use for pnpm 11 when the runner's Node version can run pnpm 11.
exe-lock.json@pnpm/exe 11.28.10Use for pnpm 11 in standalone mode or when the runner's Node version is too old.
native-lock.jsonpnpm 12.17.0Use for pnpm 12 targets. The package supplies native executables for supported runner platforms.

The standalone and native packages include platform-specific pnpm builds. This gives the action a path to a working pnpm command without relying only on the runner's Node runtime.

Bootstrap variants

The regular variant starts pnpm through the runner's Node process. The standalone variant carries its own executable path for older system Node versions. The native variant is selected for pnpm 12 targets and uses the platform package supplied by pnpm. src/…/run.ts

All three variants serve the same larger purpose: they provide a short-lived bootstrap command. That command performs the self-update to the requested pnpm version, and the resulting executable becomes the one exposed to later action steps. src/…/run.ts

References: src/…/run.ts• L37-54 src/…/run.ts• L101-127 src/…/pnpm-lock.json• L1-29 src/…/exe-lock.json• L1-37 src/…/native-lock.json• L1-22

Lock data contract

Each embedded file is an npm lock document. Its root dependency names the bootstrap package, and its package records pin the version, registry location, and integrity value that npm uses during the install. The files are generated artifacts, not the action's main dependency lock data.

The lock data also records the platform choices for executable packages. Optional packages identify supported operating systems, CPU types, and libc variants, so npm can select the binary that matches the runner while retaining integrity data for the available choices. src/…/exe-lock.json, src/…/native-lock.json

At run time, the installer reads the pinned version from the selected lock file. It creates a matching small package manifest and runs npm in the destination directory with the embedded lock document. This makes the lock file and the manifest work as one contract. src/…/run.ts, src/…/run.ts

Version and integrity records

The package version appears in both the root dependency declaration and the package record. The integrity and resolved values bind the bootstrap to a specific registry artifact. A refresh must keep these records aligned so the installer does not request one version while the lock data describes another.

The current generated artifacts pin pnpm 11.28.10 for the regular and standalone paths. The native artifact pins pnpm 12.17.0. These values are snapshots of the bootstrap packages selected when the artifacts were last refreshed; they are not necessarily the workflow's final pnpm version. src/…/pnpm-lock.json, src/…/exe-lock.json, src/…/native-lock.json

References: src/…/pnpm-lock.json• L1-29 src/…/exe-lock.json• L1-307 src/…/native-lock.json• L1-247 src/…/run.ts• L14-30 src/…/run.ts• L47-54

Artifact refresh process

The refresh script rebuilds all three embedded lock files from npm metadata. It uses one pnpm 11 version for the regular and standalone packages, and one pnpm 12 version for the native package. It then writes the generated results into the bootstrap directory for review and packaging with the action.

The maintenance flow is:

flowchart LR
    A[Version arguments or npm dist-tags] --> B[Create temporary package manifest]
    B --> C[Generate npm lock data]
    C --> D[Set artifact name]
    D --> E[Write embedded lock file]
    E --> F[Repeat for three artifacts]
    F --> G[Remove temporary directory]

Version selection

When the command has no version arguments, the script asks npm for pnpm distribution tags. It prefers next-11 and then latest-11 for the regular and standalone artifacts. It prefers next-12 and then latest-12 for the native artifact. Supplied arguments skip the matching tag lookup. scripts/update-bootstrap.mjs

The first argument controls both the regular pnpm package and the standalone executable package. The second argument controls the native pnpm package. This keeps the two pnpm 11 paths aligned while allowing the pnpm 12 bootstrap to use its own release line. scripts/update-bootstrap.mjs

References: scripts/update-bootstrap.mjs• L10-31

Generated lock files

For each artifact, the script creates a temporary private package manifest and asks npm to generate lock data without running package scripts. It then assigns the stable artifact name, writes formatted JSON to the bootstrap directory, and removes the temporary directory even when generation fails. scripts/update-bootstrap.mjs

The repository exposes this operation through the update-bootstrap package script. An engineer who refreshes the artifacts should treat all three lock files as one change because the script regenerates them together. package.json

References: scripts/update-bootstrap.mjs• L8-18 scripts/update-bootstrap.mjs• L33-46 package.json• L3-8

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep each lock file's root dependency and package record aligned with the manifest built by the installer.
  • Keep the pnpm 11 versions aligned between pnpm-lock.json and exe-lock.json unless the installer selection rules change with them.
  • Check the native and standalone platform records when changing their pnpm versions. They control which runner binary npm can select.
  • Keep the next-11/latest-11 and next-12/latest-12 selection rules aligned with the pnpm major lines supported by the installer.
  • Review the action bundle and validation flow after regenerating artifacts because the lock data ships inside the action and affects the first network install.

Important failure modes

TriggerConsequenceGuard
A lock file's root dependency and package record use different versionsnpm may reject the install or produce a bootstrap different from the version read by the installerRegenerate the file with update-bootstrap instead of editing generated JSON by hand.
The pnpm 11 lock files use different versionsRegular and standalone bootstrap paths start from different release dataPass one pnpm 11 version to the refresh script and review both files as a pair.
npm cannot resolve a selected distribution tag or packageThe refresh stops before it produces a usable artifactSupply a known version and verify access to the npm registry.
Native or standalone platform records do not include the runner's platformnpm cannot install a matching executablePreserve the platform-specific optional package records when refreshing.
The native artifact is missing or its version is stalepnpm 12 targets cannot receive their intended bootstrapRegenerate all three lock files together and check the native version used by the installer.

Key files

FileWhy to read it
src/…/run.tsShows how the action selects a bootstrap variant, installs it with npm, and moves to the requested pnpm version.
src/…/pnpm-lock.jsonShows the pinned regular pnpm 11 bootstrap package and its integrity record.
src/…/exe-lock.jsonShows the standalone pnpm 11 package and its platform-specific package choices.
src/…/native-lock.jsonShows the pnpm 12 package and its platform-specific executable choices.
scripts/update-bootstrap.mjsDefines how maintainers select versions and refresh all embedded lock files from npm.
package.jsonExposes the repository command used to refresh the generated artifacts.