From 7848c82eedfcbdcdc6c799424af52f7938263132 Mon Sep 17 00:00:00 2001 From: Peter Ashwood Date: Tue, 12 May 2026 18:06:01 +0000 Subject: [PATCH] feat(setup-node): only upgrade npm if version is specified --- setup-node/action.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup-node/action.yml b/setup-node/action.yml index 8adec34..72a8649 100644 --- a/setup-node/action.yml +++ b/setup-node/action.yml @@ -7,7 +7,7 @@ inputs: required: true npm-version: description: 'The version of npm to install' - default: 'latest' + default: '' use-stamp-cache: description: 'Whether or not to use the stamp cache (skip install, use old node_modules)' default: 'false' @@ -27,10 +27,13 @@ runs: node-version: ${{ inputs.node-version }} registry-url: ${{ inputs.registry-url }} - - run: npx npm -g i npm@${{ inputs.npm-version }} + - run: | + npx npm -g i npm@${{ inputs.npm-version }} + npm -v working-directory: ${{ inputs.working-directory }} shell: bash name: Upgrade npm + if: inputs.npm-version != '' - name: Get npm cache directory id: npm-cache-dir