更新 actions/setup-node 操作,添加 pnpm 缓存支持和条件逻辑

This commit is contained in:
严浩
2025-11-07 23:59:33 +08:00
parent 8302cf7807
commit ed22d4eca5

View File

@@ -187,9 +187,16 @@ runs:
package_json_file: ${{ inputs.working-directory }}/package.json
- uses: actions/setup-node@v5 # https://github.com/actions/setup-node?tab=readme-ov-file#usage
if: steps.prepare.outputs.pnpmLockExists == 'true'
with:
node-version: ${{ steps.prepare.outputs.nodeVersion }}
cache: 'pnpm'
cache-dependency-path: ${{ inputs.working-directory }}/pnpm-lock.yaml
- uses: actions/setup-node@v5 # https://github.com/actions/setup-node?tab=readme-ov-file#usage
if: steps.prepare.outputs.pnpmLockExists != 'true'
with:
node-version: ${{ steps.prepare.outputs.nodeVersion }}
cache: ''
- id: pnpm-store-dir
shell: bash