Repository navigation
fix(ctcOpen,ctcClose): default package-manager-version to empty, not '10' - #196
Conversation
Any pnpm caller whose package.json pins a different pnpm version via the packageManager field (e.g. pnpm@12.8.2) hits a hard error from pnpm/action-setup: 'Multiple versions of pnpm specified' -- because this workflow was passing version: '10' unconditionally whenever package-manager: pnpm is set, even though pnpm/action-setup already knows how to read packageManager from package.json on its own. Defaulting to an empty string lets pnpm/action-setup's own version resolution take over (it only errors when the version input is a *mismatched non-empty* value), so callers don't need to duplicate their pnpm version here and keep it in sync by hand. No other caller currently sets package-manager: pnpm, so this is a no-op for every existing workflow and only changes behavior for new pnpm adopters (fixes forcedotcom/salesforcedx-vscode's publishVSCode.yml and publishOpenVSX.yml, which previously had to work around this with an explicit package-manager-version: '' override).
Same bug as ctcOpen.yml (previous commit in this PR): defaulting to '10' forces an explicit version into pnpm/action-setup, which then conflicts with any caller's package.json packageManager field. Empty string lets it resolve the version from packageManager on its own. Confirmed needed in forcedotcom/salesforcedx-vscode's publishVSCode.yml/ publishOpenVSX.yml ctcCloseSuccess/ctcCloseFail jobs -- see forcedotcom/salesforcedx-vscode#8467.
mshanemc
left a comment
There was a problem hiding this comment.
I like this change; worth an agentic github search to know who's using it. IIRC we left the 10 on there because somebody was using it and had expected 10.
so check to see who that is and make sure they either pass the version they want OR have packageManager set correctly in the pjson
|
Ran the agentic search — checked both
So no current caller breaks from this change. One related gap found along the way, not fixed here: (Caveat: |
Summary
ctcOpen.ymlandctcClose.ymldefaultpackage-manager-versionto'10'and pass it unconditionally topnpm/action-setupwheneverpackage-manager: pnpmis set -- even thoughpnpm/action-setupalready knows how to read the pnpm version from the caller'spackage.jsonpackageManagerfield on its own.package.jsonpins a different pnpm version (e.g.pnpm@12.8.2) hits a hard error:Multiple versions of pnpm specifiedfrompnpm/action-setup, because that action only errors when itsversioninput is a mismatched, non-empty value.package-manager-versionto''in both workflows instead of'10'. This letspnpm/action-setup's own resolution take over, so callers don't need to duplicate (and keep in sync by hand) a pnpm version that's already declared in theirpackage.json.package-manager: pnpm(confirmed viagh search code "package-manager: pnpm"), so this is a no-op for every existing workflow and only changes behavior for pnpm adopters going forward.Context
Hit this in
forcedotcom/salesforcedx-vscode'spublishVSCode.yml/publishOpenVSX.yml(pnpm monorepo), which had to work around it with explicitpackage-manager-version: ''overrides on both thectc-openandctcClosejob calls -- see forcedotcom/salesforcedx-vscode#8466 and #8467. This PR fixes it at the source so future pnpm callers don't need to know about the gotcha.Test plan
forcedotcom/salesforcedx-vscoderelease publish confirmsctc-open/ctcClosestill succeed (now redundant with their own overrides, but harmless)🤖 Generated with Claude Code