From 1fcbdefb2f8ebb00bdaf61c10bab1ccd3270cc73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Sat, 12 Oct 2024 15:36:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=20action.yml=20=E4=B8=AD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AF=B9=20.npmrc=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E6=80=A7=E7=9A=84=E6=A3=80=E6=9F=A5=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E7=A1=AE=E4=BF=9D=E6=AD=A3=E7=A1=AE=E6=8F=90=E5=8F=96?= =?UTF-8?q?=20Node=20=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup-node-environment/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup-node-environment/action.yml b/setup-node-environment/action.yml index d8cb431..af20e8e 100644 --- a/setup-node-environment/action.yml +++ b/setup-node-environment/action.yml @@ -68,7 +68,9 @@ runs: # Extract the node version from the .npmrc file set -x; - nodeVersion=$(grep 'use-node-version=' .npmrc | sed -E 's/^use-node-version=([0-9.]+).*/\1/') + if [ -f ".npmrc" ]; then + nodeVersion=$(grep 'use-node-version=' .npmrc | sed -E 's/^use-node-version=([0-9.]+).*/\1/') + fi if [ -z "$nodeVersion" ]; then nodeVersion="lts/*" fi