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