Compare commits

...

3 Commits

Author SHA1 Message Date
Jeong Min O
3810288b3a
Merge e2805aa8fd into 0d0b43217a 2024-07-05 15:22:53 +02:00
Zoltan Kochan
0d0b43217a
docs: add warning about v2 2024-07-05 14:37:28 +02:00
Jeong Min O
e2805aa8fd
Support wildcard for version 2024-06-27 11:14:44 +09:00
2 changed files with 12 additions and 9 deletions

View File

@ -1,3 +1,7 @@
> ## :warning: Upgrade from v2!
>
> 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.
# Setup pnpm
Install pnpm package manager.

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}`
}