mirror of
https://github.com/pnpm/action-setup.git
synced 2026-07-01 17:41:41 +00:00
Compare commits
3 Commits
3810288b3a
...
d656a12fa5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d656a12fa5 | ||
|
|
18ac635edf | ||
|
|
e2805aa8fd |
13
README.md
13
README.md
@ -150,19 +150,6 @@ jobs:
|
|||||||
node-version: 20
|
node-version: 20
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Get pnpm store directory
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
|
||||||
name: Setup pnpm cache
|
|
||||||
with:
|
|
||||||
path: ${{ env.STORE_PATH }}
|
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pnpm-store-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install
|
run: pnpm install
|
||||||
```
|
```
|
||||||
|
|||||||
@ -57,16 +57,15 @@ async function readTarget(opts: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (version) {
|
if (version) {
|
||||||
if (
|
if (typeof packageManager === 'string') {
|
||||||
typeof packageManager === 'string' &&
|
const packageManagerVersion = packageManager.replace('pnpm@', '')
|
||||||
packageManager.replace('pnpm@', '') !== version
|
if(packageManagerVersion !== version && packageManagerVersion !== '*')
|
||||||
) {
|
throw new Error(`Multiple versions of pnpm specified:
|
||||||
throw new Error(`Multiple versions of pnpm specified:
|
- version ${version} in the GitHub Action config with the key "version"
|
||||||
- version ${version} in the GitHub Action config with the key "version"
|
- version ${packageManager} in the package.json with the key "packageManager"
|
||||||
- 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`)
|
||||||
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}`
|
return `${ standalone ? '@pnpm/exe' : 'pnpm' }@${version}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user