Setup pnpm
Set up Node.js and pnpm in one step, optionally installing dependencies. Wraps the official
pnpm/action-setup (actively maintained by the pnpm org)
rather than corepack enable — Node.js is removing Corepack from its default distribution
starting with Node.js 26, so relying on it to install pnpm is no longer safe.
Requirements
Section titled “Requirements”- Checkout the repository yourself before this action (with the
fetch-depthyour job needs) — this action does not runactions/checkout, since callers differ on depth. - The repo’s
packageManagerfield inpackage.jsonselects the pnpm version by default; pass the version input explicitly for repos without one.
Inputs
Section titled “Inputs”- node-version (required): Node.js version to install, passed straight to
actions/setup-node. - version: pnpm version to install (default: empty — auto-detected from the
packageManagerfield inpackage.json). Required if the repo has nopackage.jsonor nopackageManagerfield. - install: Run
pnpm installafter setup (default:true). Set tofalseif you only need Node + pnpm onPATHwithout installing dependencies. - frozen-lockfile: Pass
--frozen-lockfiletopnpm install(default:true). Set tofalsefor workflows that intentionally update the lockfile. - working-directory: Directory containing
package.json/pnpm-lock.yaml, and wherepnpm installruns (default:.). - cache: Cache the pnpm store directory, passed straight to
pnpm/action-setup’s owncacheinput (default:true).
Outputs
Section titled “Outputs”None — Node.js and pnpm are left configured on PATH for subsequent steps.