Skip to content

Commit 539956c

Browse files
committed
feat: do not run pnpm install automatically
Other setup actions (actions/setup-node, setup-python, oven-sh/setup-bun, denoland/setup-deno) install the toolchain only and leave dependency installation to the caller. Match that convention instead of providing an opt-out for cases like `pnpm audit` or lockfile-only regeneration jobs (see pnpm/pnpm#11589) that don't want the install.
1 parent c4ced00 commit 539956c

4 files changed

Lines changed: 172 additions & 255 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Install pnpm **and** a JavaScript runtime (Node.js, Bun, or Deno) in a single GitHub Actions step.
44

5-
The action installs pnpm from the standalone `@pnpm/exe` package (no system Node.js required) and then uses `pnpm runtime set` to install the requested runtime. The runtime binary is placed on `PATH` for subsequent steps, replacing the need for `actions/setup-node`, `oven-sh/setup-bun`, or `denoland/setup-deno`. `pnpm install` runs automatically when a `package.json` is present.
5+
The action installs pnpm from the standalone `@pnpm/exe` package (no system Node.js required) and then uses `pnpm runtime set` to install the requested runtime. The runtime binary is placed on `PATH` for subsequent steps, replacing the need for `actions/setup-node`, `oven-sh/setup-bun`, or `denoland/setup-deno`. Like other setup actions, this one does not run `pnpm install` — add an explicit step for that.
66

77
If your `package.json` declares `devEngines.runtime`, the action picks up the runtime and version from there automatically — no inputs required.
88

@@ -48,11 +48,10 @@ jobs:
4848
- uses: actions/checkout@v6
4949
- uses: pnpm/setup@v0
5050
- run: node --version
51+
- run: pnpm install
5152
- run: pnpm test
5253
```
5354
54-
`pnpm install` runs automatically because the workspace has a `package.json`.
55-
5655
### Matrix: test on multiple Node versions
5756
5857
```yaml
@@ -67,6 +66,7 @@ jobs:
6766
- uses: pnpm/setup@v0
6867
with:
6968
runtime: node@${{ matrix.node }}
69+
- run: pnpm install
7070
- run: pnpm test
7171
```
7272
@@ -95,7 +95,7 @@ jobs:
9595
1. The action installs `@pnpm/exe` (a Node.js-bundled standalone build of pnpm) into `dest`, then self-updates to the requested pnpm version.
9696
2. `PNPM_HOME` is exported and `$PNPM_HOME/bin` is added to `PATH`.
9797
3. The action runs `pnpm runtime set <name> <version> -g`, which downloads the requested runtime into `$PNPM_HOME/bin` — making `node`, `bun`, or `deno` available to later workflow steps.
98-
4. If a `package.json` exists in the workspace, the action runs `pnpm install`. When the `runtime` input is set, `--no-runtime` is appended so the just-installed runtime isn't shadowed by a different version declared in `devEngines.runtime`. This flag requires pnpm ≥ 11.1.0.
98+
4. Running `pnpm install` is left to the caller.
9999

100100
## License
101101

0 commit comments

Comments
 (0)