From 64403850ee19c556e3dbed40591fb13fe7cb763c Mon Sep 17 00:00:00 2001 From: Lyda <1829913225@qq.com> Date: Thu, 18 Sep 2025 11:43:21 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96pnpm=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E6=B5=81=E7=A8=8B=E5=B9=B6=E5=90=88=E5=B9=B6=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E7=9A=84pnpm=E8=AE=BE=E7=BD=AE=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- npm-install/action.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/npm-install/action.yml b/npm-install/action.yml index 47562a5..15684ef 100644 --- a/npm-install/action.yml +++ b/npm-install/action.yml @@ -129,8 +129,8 @@ runs: restore-keys: | ${{ runner.os }}-corepack-pnpm- - - name: 确保 pnpm 可用(用于计算 store 路径) - if: inputs.package-manager == 'pnpm' && inputs.cache-mode == 'store' + - name: 确保 pnpm 可用 + if: inputs.package-manager == 'pnpm' uses: pnpm/action-setup@v4 with: version: ${{ inputs.pnpm-version }} @@ -186,18 +186,15 @@ runs: shell: bash run: | if [[ "${{ steps.cache.outputs.cache-hit }}" == "true" ]]; then - echo "✅ 缓存命中,跳过依赖安装" + if [[ "${{ inputs.cache-mode }}" == "store" ]]; then + echo "✅ 缓存命中(store),将执行快速链接安装(不会下载包,仅链接)" + else + echo "✅ 缓存命中,跳过依赖安装" + fi else echo "⚠️ 缓存未命中,开始安装依赖" fi - - name: 确保 pnpm 可用(如需) - if: inputs.package-manager == 'pnpm' - uses: pnpm/action-setup@v4 - with: - version: ${{ inputs.pnpm-version }} - run_install: false - - name: 安装依赖 if: (inputs.cache-mode == 'node_modules' && steps.cache.outputs.cache-hit != 'true') || (inputs.cache-mode == 'store') shell: bash