1
0
mirror of https://github.com/pnpm/action-setup.git synced 2026-03-04 08:01:02 +08:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Jeong Min O
80ef5a4602
Merge e2805aa8fd into ac5bf11548 2024-08-14 16:58:28 +02:00
Jeong Min O
e2805aa8fd
Support wildcard for version 2024-06-27 11:14:44 +09:00

View File

@ -57,16 +57,15 @@ async function readTarget(opts: {
}
if (version) {
if (
typeof packageManager === 'string' &&
packageManager.replace('pnpm@', '') !== version
) {
throw new Error(`Multiple versions of pnpm specified:
- version ${version} in the GitHub Action config with the key "version"
- version ${packageManager} in the package.json with the key "packageManager"
Remove one of these versions to avoid version mismatch errors like ERR_PNPM_BAD_PM_VERSION`)
if (typeof packageManager === 'string') {
const packageManagerVersion = packageManager.replace('pnpm@', '')
if(packageManagerVersion !== version && packageManagerVersion !== '*')
throw new Error(`Multiple versions of pnpm specified:
- version ${version} in the GitHub Action config with the key "version"
- version ${packageManager} in the package.json with the key "packageManager"
Remove one of these versions to avoid version mismatch errors like ERR_PNPM_BAD_PM_VERSION`)
return `${ standalone ? '@pnpm/exe' : 'pnpm' }@${packageManagerVersion}`
}
return `${ standalone ? '@pnpm/exe' : 'pnpm' }@${version}`
}