Skip to content

Commit 828ddad

Browse files
River (AI)craigmichaelmartin
andcommitted
Fix empty string fallback for comment_package_manager
When comment_package_manager input is not set, core.getInput() returns an empty string. Using nullish coalescing (??) fails to fall back to the auto-detected packageManager because empty string is not nullish. This causes the install command to render as 'i -g' instead of 'npm i -g'. Switch to logical OR (||) so empty string correctly falls through to the detected package manager. Co-authored-by: Craig Martin <craig.martin@shopify.com>
1 parent 6446eb8 commit 828ddad

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

dist/index.js

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ try {
214214
: `Your snapshot${multiple ? 's have' : ' has'} been published to npm.**\n\n`;
215215

216216
const messagePackageManager =
217-
commentPackageManager?.toLowerCase() ?? packageManager;
217+
commentPackageManager?.toLowerCase() || packageManager;
218218
let globalInstallMessage =
219219
messagePackageManager === 'yarn'
220220
? 'yarn global add'

0 commit comments

Comments
 (0)