fix: honor devEngines.packageManager.onFail=error (#252) (#254)

## Summary
- Export `pnpm_config_pm_on_fail=download` from the action so the bootstrap pnpm switches versions via `manage-package-manager-versions` instead of throwing `BAD_PM_VERSION` when a project pins `devEngines.packageManager.onFail = "error"` without supplying a `version:` input.
- Adds a `test_dev_engines_on_fail_error` workflow job (Linux/macOS/Windows, exact + range) that reproduces #252.

Fixes #252.
This commit is contained in:
Zoltan Kochan
2026-05-11 01:51:30 +02:00
committed by GitHub
parent 91ab88e261
commit 1155470f3e
3 changed files with 205 additions and 311 deletions

View File

@@ -102,7 +102,12 @@ export async function runSelfInstaller(inputs: Inputs): Promise<SelfInstallerRes
}
// No explicit target version: rely on the bootstrap pnpm to switch to
// the version declared in packageManager/devEngines at runtime.
// the version declared in packageManager/devEngines at runtime. Force
// `pmOnFail=download` so a project that pins
// `devEngines.packageManager.onFail = "error"` doesn't trip BAD_PM_VERSION
// before the switch can happen (issue #252). Scoped to this branch so users
// who pass an explicit `version:` input keep strict onFail behavior.
exportVariable('pnpm_config_pm_on_fail', 'download')
return { exitCode: 0, binDest: pnpmHome }
}