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

Compare commits

...

3 Commits

Author SHA1 Message Date
Jeong Min O
01b11c325f
Merge e2805aa8fd into e303250a24 2025-01-20 10:55:06 +02:00
Azat S.
e303250a24
docs: update pnpm version in readme examples (#154) 2025-01-09 00:42:18 +01: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: 9
version: 10
```
### Install only pnpm with `packageManager`
@ -116,7 +116,7 @@ jobs:
- uses: pnpm/action-setup@v4
with:
version: 9
version: 10
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: 9
version: 10
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}`
}