Compare commits

..

1 commit

Author SHA1 Message Date
Kevin Cui
d648c2dd06
fix: not allow install multiple package manager (#161)
Some checks failed
Test Action / Test with default inputs (push) Has been cancelled
Test Action / Test with dest (push) Has been cancelled
Test Action / Test with standalone (push) Has been cancelled
Test Action / Test with run_install (array, macos-latest) (push) Has been cancelled
Test Action / Test with run_install (empty object, macos-latest) (push) Has been cancelled
Test Action / Test with run_install (global, macos-latest) (push) Has been cancelled
Test Action / Test with run_install (null, macos-latest) (push) Has been cancelled
Test Action / Test with run_install (recursive, macos-latest) (push) Has been cancelled
Test Action / Test with run_install (array, ubuntu-latest) (push) Has been cancelled
Test Action / Test with run_install (empty object, ubuntu-latest) (push) Has been cancelled
Test Action / Test with run_install (global, ubuntu-latest) (push) Has been cancelled
Test Action / Test with run_install (null, ubuntu-latest) (push) Has been cancelled
Test Action / Test with run_install (recursive, ubuntu-latest) (push) Has been cancelled
Test Action / Test with run_install (array, windows-latest) (push) Has been cancelled
Test Action / Test with run_install (empty object, windows-latest) (push) Has been cancelled
Test Action / Test with run_install (global, windows-latest) (push) Has been cancelled
Test Action / Test with run_install (null, windows-latest) (push) Has been cancelled
Test Action / Test with run_install (recursive, windows-latest) (push) Has been cancelled
When a project has both npm and pnpm, using pnpm/action-setup will result in an error: `Multiple versions of pnpm specified`.

The previous implementation was only meant to avoid the "ERR_PNPM_BAD_PM_VERSION" error, but it did not take into account the situation of multiple different package managers.

Signed-off-by: Kevin Cui <bh@bugs.cc>
2025-03-28 08:37:14 +08:00

View file

@ -64,6 +64,7 @@ async function readTarget(opts: {
if (version) {
if (
typeof packageManager === 'string' &&
packageManager.startsWith('pnpm@') &&
packageManager.replace('pnpm@', '') !== version
) {
throw new Error(`Multiple versions of pnpm specified: