mirror of
https://git.bjxgj.com/xgj/xgj-actions.git
synced 2025-10-14 04:13:37 +08:00
refactor: 优化pnpm安装流程并合并重复的pnpm设置步骤
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user