mirror of
https://github.com/pnpm/action-setup.git
synced 2026-04-02 10:02:27 +08:00
fix: extract pnpm version from packageManager field instead of returning undefined (#216)
When packageManager is set to e.g. "pnpm@9.1.0+sha...", strip the "pnpm@" prefix and any "+sha..." hash suffix so the action installs the correct version. Previously returning undefined caused failures on Windows.
This commit is contained in:
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -101,8 +101,8 @@ Remove one of these versions to avoid version mismatch errors like ERR_PNPM_BAD_
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (typeof packageManager === 'string' && packageManager.startsWith('pnpm@')) {
|
if (typeof packageManager === 'string' && packageManager.startsWith('pnpm@')) {
|
||||||
// pnpm will handle version management via packageManager field
|
// Strip the "pnpm@" prefix and any "+sha..." hash suffix
|
||||||
return undefined
|
return packageManager.replace('pnpm@', '').replace(/\+.*$/, '')
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GITHUB_WORKSPACE) {
|
if (!GITHUB_WORKSPACE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user