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 testOn 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
peaceiris/actions-gh-pages: Deploy to GitHub PagesReference for peaceiris/actions-gh-pages: push a built static site to the gh-pages branch using GITHUB_TOKEN…
slackapi/slack-github-action: Send Slack NotificationsReference for slackapi/slack-github-action: post build status to Slack via a webhook or the Web API, with pay…
JamesIves/github-pages-deploy-action: Deploy to PagesReference for JamesIves/github-pages-deploy-action: deploy a built folder to a GitHub Pages branch, with fold…