|
| 1 | +# W-24093892 — 2.2 Add pnpmInstallWithRetries sibling action |
| 2 | + |
| 3 | +## Context |
| 4 | + |
| 5 | +`setupNodeAndInstall` already installs npm and Yarn through sibling composite actions, and resolves the default pnpm install to `pnpm install --frozen-lockfile`. That pnpm command still runs through the generic `retry` step (`.github/actions/setupNodeAndInstall/action.yml`). |
| 6 | + |
| 7 | +Add `.github/actions/pnpmInstallWithRetries/action.yml` next to: |
| 8 | + |
| 9 | +- `.github/actions/npmInstallWithRetries/action.yml` — `npm ci` via `retry`, `ignore-scripts` input |
| 10 | +- `.github/actions/yarnInstallWithRetries/action.yml` — `yarn install --network-timeout 600000` via `retry`, `ignore-scripts` input |
| 11 | + |
| 12 | +Route the default pnpm command in `setupNodeAndInstall` through the new action. Custom `install-command` values stay on the generic `retry` step. |
| 13 | + |
| 14 | +## Phases |
| 15 | + |
| 16 | +### 1. Add the pnpm sibling and call it from setupNodeAndInstall |
| 17 | + |
| 18 | +Commit: `Add pnpmInstallWithRetries for the default frozen-lockfile install` |
| 19 | + |
| 20 | +Files: |
| 21 | + |
| 22 | +- `.github/actions/pnpmInstallWithRetries/action.yml` (new) |
| 23 | +- `.github/actions/setupNodeAndInstall/action.yml` |
| 24 | + |
| 25 | +`pnpmInstallWithRetries` is a composite action: |
| 26 | + |
| 27 | +- `name`: `pnpm-install-with-retries` |
| 28 | +- `description`: wraps `pnpm install --frozen-lockfile` with retries/timeout to handle network failures |
| 29 | +- input `ignore-scripts`, default `'false'`, same description as the npm and yarn actions |
| 30 | +- one step, `pnpm install`, `uses: salesforcecli/github-workflows/.github/actions/retry@main` |
| 31 | +- `command`: `pnpm install --frozen-lockfile ${{ inputs.ignore-scripts == 'true' && '--ignore-scripts' || '' }}` |
| 32 | + |
| 33 | +In `setupNodeAndInstall`, after the Yarn install step, add: |
| 34 | + |
| 35 | +- name `Install pnpm dependencies` |
| 36 | +- `if: inputs.package-manager == 'pnpm' && steps.install-command.outputs.value == 'pnpm install --frozen-lockfile'` |
| 37 | +- `uses: salesforcecli/github-workflows/.github/actions/pnpmInstallWithRetries@main` |
| 38 | + |
| 39 | +Extend the existing custom-install `if` with `(inputs.package-manager != 'pnpm' || steps.install-command.outputs.value != 'pnpm install --frozen-lockfile')` so the default pnpm command is only installed by the sibling. Rename that step from `Install custom or pnpm dependencies` to `Install custom dependencies`. |
| 40 | + |
| 41 | +`setupNodeAndInstall` does not pass `ignore-scripts` into the npm or yarn actions; the pnpm call matches that. |
| 42 | + |
| 43 | +## Skills to apply |
| 44 | + |
| 45 | +Follow the composite-action shape already in `npmInstallWithRetries` and `yarnInstallWithRetries`: shared `retry` action, `ignore-scripts` input, install command equal to the string `setupNodeAndInstall` already resolves for that package manager (`pnpm install --frozen-lockfile` at the `Resolve install command` step). |
| 46 | + |
| 47 | +## Verification |
| 48 | + |
| 49 | +- New action inputs and `retry` usage match the npm and yarn siblings, with the install command `pnpm install --frozen-lockfile`. |
| 50 | +- `setupNodeAndInstall` default paths are exclusive: `npm` + `npm ci` → `npmInstallWithRetries`; `yarn` + `yarn install --network-timeout 600000` → `yarnInstallWithRetries`; `pnpm` + `pnpm install --frozen-lockfile` → `pnpmInstallWithRetries`; every other resolved command → `retry`. |
| 51 | +- Direct `npmInstallWithRetries` and `yarnInstallWithRetries` workflow uses stay unchanged. |
0 commit comments