|
1 | | -> ## :warning: Upgrade from v2! |
| 1 | +> [!IMPORTANT] |
| 2 | +> **This action has a successor: [`pnpm/setup`](https://github.com/pnpm/setup).** |
2 | 3 | > |
3 | | -> The v2 version of this action [has stopped working](https://github.com/pnpm/action-setup/issues/135) with newer Node.js versions. Please, upgrade to the latest version to fix any issues. |
| 4 | +> For pnpm v11 and newer, use [`pnpm/setup`](https://github.com/pnpm/setup) instead. It downloads pnpm's self-contained release binary (no Node.js or npm required) and can install a JavaScript runtime (Node.js, Bun, or Deno) in the same step, replacing `actions/setup-node`. |
| 5 | +> |
| 6 | +> `pnpm/action-setup` remains the action to use for installing pnpm v10 and older. See [Migrating to pnpm/setup](#migrating-to-pnpmsetup) below. |
4 | 7 |
|
5 | 8 | # Setup pnpm |
6 | 9 |
|
7 | 10 | Install pnpm package manager. |
8 | 11 |
|
| 12 | +> ## :warning: Upgrade from v2! |
| 13 | +> |
| 14 | +> The v2 version of this action [has stopped working](https://github.com/pnpm/action-setup/issues/135) with newer Node.js versions. Please, upgrade to the latest version to fix any issues. |
| 15 | +
|
| 16 | +## Migrating to pnpm/setup |
| 17 | + |
| 18 | +[`pnpm/setup`](https://github.com/pnpm/setup) installs pnpm v11+ as a native standalone executable and can install Node.js, Bun, or Deno in the same step, so a typical workflow no longer needs `actions/setup-node` or an explicit `pnpm install` step: |
| 19 | + |
| 20 | +```yaml |
| 21 | +steps: |
| 22 | + - uses: actions/checkout@v6 |
| 23 | + |
| 24 | + # Before: |
| 25 | + # - uses: pnpm/action-setup@v6 |
| 26 | + # with: |
| 27 | + # version: 10 |
| 28 | + # cache: true |
| 29 | + # - uses: actions/setup-node@v4 |
| 30 | + # with: |
| 31 | + # node-version: 22 |
| 32 | + # - run: pnpm install |
| 33 | + |
| 34 | + # After: |
| 35 | + - uses: pnpm/setup@v1 |
| 36 | + with: |
| 37 | + version: 11 |
| 38 | + runtime: node@22 |
| 39 | + cache: true |
| 40 | +``` |
| 41 | +
|
| 42 | +The `version` input can be omitted only when `packageManager` (or `devEngines.packageManager`) in `package.json` declares pnpm v11 or newer; otherwise keep it explicit, since `pnpm/setup` requires pnpm v11+. |
| 43 | + |
| 44 | +Input and output changes: |
| 45 | + |
| 46 | +| `pnpm/action-setup` | `pnpm/setup` | Notes | |
| 47 | +| ------------------- | ------------ | ----- | |
| 48 | +| `version` | `version` | Must resolve to pnpm v11 or newer. As before, it can be omitted when `packageManager` (or `devEngines.packageManager`) is set in `package.json`. | |
| 49 | +| `dest` | `dest` | Unchanged. | |
| 50 | +| `run_install` | `install` | `pnpm/setup` runs `pnpm install` automatically when a `package.json` is present (`install: true` by default); set `install: false` to skip it. The object/array form (`recursive`, `cwd`, `args`) is not supported — run those commands in separate steps. | |
| 51 | +| `cache` | `cache` | Unchanged. | |
| 52 | +| `cache_dependency_path` | `cache-dependency-path` | Renamed to kebab-case. | |
| 53 | +| `package_json_file` | `package-json-file` | Renamed to kebab-case. | |
| 54 | +| `standalone` | removed | `pnpm/setup` always installs the standalone native executable. | |
| 55 | +| n/a | `runtime` | New: installs Node.js, Bun, or Deno (e.g. `node@22`, `bun@latest`, `deno@2`), or reads `devEngines.runtime` from `package.json`. | |
| 56 | +| n/a | `token` | New: GitHub token for release lookup; defaults to `${{ github.token }}` and rarely needs to be set. | |
| 57 | +| `bin_dest` (output) | `bin-dest` (output) | Renamed to kebab-case. New outputs `runtime-name` and `runtime-version` describe the installed runtime. | |
| 58 | + |
9 | 59 | ## Inputs |
10 | 60 |
|
11 | 61 | ### `version` |
@@ -187,7 +237,7 @@ jobs: |
187 | 237 |
|
188 | 238 | ## Notes |
189 | 239 |
|
190 | | -This action does not setup Node.js for you, use [actions/setup-node](https://github.com/actions/setup-node) yourself. |
| 240 | +This action does not set up Node.js. Use [actions/setup-node](https://github.com/actions/setup-node) yourself. If you are on pnpm v11 or newer, [`pnpm/setup`](https://github.com/pnpm/setup) can install pnpm and Node.js in a single step. |
191 | 241 |
|
192 | 242 | ## License |
193 | 243 |
|
|
0 commit comments