Skip to content
Latchkey

pnpm/action-setup: Install pnpm in CI

action-setup installs pnpm so your workflow can use it for installs and scripts.

Install pnpm first, then run setup-node with cache: pnpm to cache the store. Or set run_install to install dependencies directly from this action.

Key inputs (with:)

  • version: pnpm version to install (or read packageManager).
  • run_install: run pnpm install as part of the step.
  • dest: where to install the pnpm binary.
  • standalone: install a standalone pnpm.

Example workflow

.github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4
        with:
          version: 9
      - uses: actions/setup-node@v4
        with:
          node-version: 20
          cache: pnpm
      - run: pnpm install --frozen-lockfile
      - run: pnpm test

On any runner

pnpm setup runs on any runner. Latchkey managed runners run it unchanged.

Key takeaways

  • Install pnpm before calling setup-node with cache: pnpm.
  • Order matters: setup-node needs pnpm on PATH to cache it.
  • Use --frozen-lockfile in CI for deterministic installs.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →