Compare commits

...

3 Commits

Author SHA1 Message Date
Jeong Min O
80ef5a4602
Merge e2805aa8fd into ac5bf11548 2024-08-14 16:58:28 +02:00
Karl Horky
ac5bf11548
Update examples to use pnpm v9 (#142) 2024-08-14 16:07:48 +02:00
Jeong Min O
e2805aa8fd
Support wildcard for version 2024-06-27 11:14:44 +09:00
2 changed files with 11 additions and 12 deletions

View File

@ -80,7 +80,7 @@ jobs:
steps:
- uses: pnpm/action-setup@v4
with:
version: 8
version: 9
```
### Install only pnpm with `packageManager`
@ -116,7 +116,7 @@ jobs:
- uses: pnpm/action-setup@v4
with:
version: 8
version: 9
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
@ -141,7 +141,7 @@ jobs:
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 8
version: 9
run_install: false
- name: Install Node.js

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