Knowledge Base updated: 2026-11-05
pnpm/action-setup knowledge base
Orientation
pnpm/action-setup is a GitHub Action that configures a pnpm executable, optionally restores and saves the pnpm store cache, runs configured dependency installation, prunes the store, and publishes run outputs.
The runtime is centered on the action entrypoint and separates input parsing, pnpm provisioning, cache lifecycle operations, install execution, and output publication into focused modules. The checked-in dist/index.js is the distributable artifact consumed by GitHub Actions.
Bootstrap lock data under src/install-pnpm/bootstrap/ is embedded into the action’s provisioning path. Repository scripts, package metadata, and GitHub workflows maintain that generated/distributable surface and validate pull requests.
flowchart TD
W[GitHub Actions workflow] --> A[action.yml]
A --> R[Action runtime]
R --> I[Input configuration]
I --> P[pnpm provisioning]
P --> B[Embedded bootstrap artifacts]
P --> C[Cache restoration]
C --> D[Dependency installation]
D --> S[Cache persistence]
S --> G[pnpm store pruning]
R --> O[Action outputs]
R --> X[dist/index.js]
M[Packaging and maintenance] --> X
M --> B
V[Continuous validation] --> M
Glossary
- Bootstrap artifacts — bundled lock data used while establishing pnpm for an action run.
- pnpm store — pnpm’s shared package-content store, which the action can restore, save, and prune.
- Distributable — the checked-in dist/index.js bundle executed by GitHub Actions.
- Post-install cache save — the cache persistence phase that runs after the primary installation work.
Invariants
- The action’s executable runtime remains checked in as a distributable artifact (dist/index.js) so consumers do not build TypeScript during workflow execution.
- pnpm bootstrap lock inputs are maintained together under src/…/*.json because provisioning depends on the embedded set.
- Cache restoration precedes dependency installation, while cache persistence follows it; the runtime’s cache modules are separated as
src/cache-restore/**andsrc/cache-save/**. - Pull-request validation is defined in repository workflow files, including .github/…/pr-check.yaml and .github/…/test.yaml.
Routing table
- action.yml, src/index.ts, dist/index.js -> Action runtime orchestration
- src/inputs.ts, action.yml -> Action inputs and install configuration
- src/…/run.ts,
src/install-pnpm/**-> pnpm provisioning - src/…/run.ts,
src/install-pnpm/**-> Dependency installation src/cache-restore/**-> Cache restorationsrc/cache-save/**-> Cache persistencesrc/prune-store/**-> pnpm store pruning- src/outputs.ts, src/index.ts -> Action outputs
- package.json,
dist/**,scripts/**-> Action packaging and maintenance - src/…/*.json,
scripts/**-> Embedded pnpm bootstrap artifacts - .github/…/*.yaml, .github/…/*.yml -> Continuous validation