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 / action-outputs

Action outputs

The action publishes the paths that a workflow needs to find the pnpm installation. It derives these values from the expanded destination input and the directory returned by pnpm provisioning, then exposes them after a successful setup.

Output contract

The public output contract is defined in home/…/action.yml. Both outputs are strings and belong to the action step that runs pnpm/action-setup.

OutputMeaningSource of value
destExpanded directory used for the action's pnpm filesThe parsed dest input
bin_destDirectory that contains the usable pnpm and pnpx commandsThe successful provisioning result

The dest output reports the resolved path rather than the input text. For example, a home-directory marker in the input becomes the matching absolute or expanded path before publication.

Destination output

The dest output tells consumers where the action keeps its pnpm installation data. It comes from the same parsed value used by provisioning, so a later step can use it to locate action-managed files without repeating path expansion.

References: home/…/action.yml• L34-38 home/…/index.ts• L19-28 home/…/index.ts• L4-8

Binary directory output

The bin_dest output tells consumers which directory contains the pnpm command for this run. Provisioning selects the directory that exposes the requested version, including the updated binary directory when self-update creates one and the bootstrap directory when no separate updated directory exists.

References: home/…/action.yml• L34-39 home/…/run.ts• L62-69 home/…/run.ts• L87-105 home/…/index.ts• L4-8

Publication sequence

The main action run publishes outputs only after pnpm provisioning succeeds. This order makes the outputs describe a usable setup rather than a planned or partial setup.

The following flow shows how runtime state becomes the published output contract.

flowchart LR
    A[Action inputs] --> B[Expanded runtime inputs]
    B --> C[pnpm provisioning]
    C -->|success| D[binDest]
    B --> E[dest]
    D --> F[GitHub Actions outputs]
    E --> F
    C -->|failure| G[Failed action]
    G -.->|no output publication| F

The entrypoint reads inputs and stores them as action state for the later post phase. It then receives binDest from provisioning, publishes dest and bin_dest, and only after that starts cache restoration and dependency installation. The post phase uses the saved input state for pruning and cache persistence; it does not create a second output set.

Successful setup state

On a successful setup, dest and bin_dest are available to later workflow steps through the action step's output context. The bin_dest value is the path to use when a consumer needs an explicit command path instead of relying on the action's PATH update.

References: home/…/index.ts• L18-31 home/…/index.ts• L7-15 home/…/index.ts• L4-9

Failed setup state

If provisioning returns a failure, the entrypoint stops before it calls the output publisher. A version-selection error also fails the action before a valid binary directory exists, so consumers must treat the outputs as available only when the setup step succeeds.

References: home/…/index.ts• L18-27 home/…/index.ts• L7-15 home/…/run.ts• L87-95 home/…/run.ts• L139-179

Workflow consumption

Workflow authors use the output names from action.yml through the step identifier assigned to the setup action. The outputs support explicit command paths when a later step needs a stable reference to the pnpm installation.

For example, a workflow can consume the binary directory as ${{ steps.pnpm.outputs.bin_dest }} and append pnpm for a direct command path. The action also adds its command directory to PATH, so ordinary pnpm calls can use the runner environment without reading the output.

The output contract is one part of the action runtime. Action runtime orchestration explains when publication occurs, while action inputs explains the values that supply the runtime state. pnpm provisioning explains how the binary directory is selected. Dependency installation, cache restoration, cache persistence, and pnpm store pruning describe the work that follows or uses the same runtime state.

References: home/…/action.yml• L34-42 home/…/index.ts• L23-36 home/…/run.ts• L67-69

Change checklist

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

  • Keep the output names in action.yml aligned with the names passed to setOutput.
  • Keep bin_dest aligned with the directory whose command is first on the action-managed PATH. A mismatch can make explicit output consumers run a different pnpm version from ordinary pnpm calls.
  • Preserve the success boundary before output publication. Do not expose paths from a failed or incomplete provisioning run.
  • If path expansion changes, check both the provisioning destination and the value reported by dest.

Important failure modes

TriggerConsequenceGuard
Provisioning exits with a non-zero statusThe action fails before it publishes dest or bin_dest.Use the outputs only after the setup step succeeds.
bin_dest points to the bootstrap directory after a self-updateAn explicit consumer can run the old bootstrap pnpm instead of the requested version.Return the updated binary directory when it exists and keep the output tied to the active command path.
Output name changes in only one contract locationGitHub Actions expressions resolve an unset output even though the action may still publish another name.Change the metadata declaration and setOutput call together.

Key files

FileWhy to read it
home/…/action.ymlDefines the public output names and their user-facing meanings.
home/…/index.tsPublishes the two output values for the action step.
home/…/index.tsShows the success boundary and the point in the run where outputs become available.
home/…/index.tsShows how the destination input becomes the runtime value reported as dest.
home/…/run.tsShows how provisioning derives the active binary directory reported as bin_dest.