From c7fa63d9b55e29a5aba486fc64864a7ca3a96600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Sat, 12 Oct 2024 18:35:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=AF=B9=20pnpm?= =?UTF-8?q?=20=E5=92=8C=20node=20=E7=89=88=E6=9C=AC=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup-node-environment/action.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/setup-node-environment/action.yml b/setup-node-environment/action.yml index 23d78df..b531489 100644 --- a/setup-node-environment/action.yml +++ b/setup-node-environment/action.yml @@ -38,7 +38,7 @@ runs: shell: bash id: prepare run: | - # Check package manager + # 判断是否需要 pnpm/action-setup echo "#############################" setupPnpm=false packageManager=$(node -p "require('./package.json').packageManager") @@ -46,24 +46,26 @@ runs: if [[ "$packageManager" == "pnpm"* ]] && ! which pnpm > /dev/null; then echo "the package manager is pnpm but pnpm is not installed" setupPnpm=true + else + echo "the package manager is not pnpm or pnpm is already installed" fi echo "setupPnpm: $setupPnpm" echo "setup-pnpm=$setupPnpm" >> $GITHUB_OUTPUT echo "" - # Check if pnpm-lock.yaml exists + # 判断是否需要运行 pnpm install echo "#############################" if [[ -f "pnpm-lock.yaml" ]]; then echo "pnpm-lock.yaml exists. So pnpm install --frozen-lockfile will run" echo "pnpm-lock-exists=true" >> $GITHUB_OUTPUT echo "cache=pnpm" >> $GITHUB_OUTPUT else - echo "pnpm-lock.yaml does not exist" + echo "pnpm-lock.yaml does not exist. So pnpm install will not run" fi echo "" - # Extract the node version from the .npmrc file + # 设置 node 版本 echo "#############################" nodeVersion=$(sed -n 's/.*use-node-version=\([0-9.]*\).*/\1/p' .npmrc) if [[ -z "$nodeVersion" ]]; then