修复缓存命中状态的输出逻辑,并更新 pnpm 缓存保存条件

This commit is contained in:
mini2024
2025-04-06 03:31:55 +08:00
parent 694d8c00ce
commit d6f6c773a7

View File

@ -182,6 +182,7 @@ runs:
restore-keys: |
${{ runner.os }}-pnpm-store-
# https://github.com/pnpm/pnpm/issues/7192#issuecomment-2353298966
- run: echo "package-import-method=hardlink" >> .npmrc
shell: bash
@ -208,18 +209,15 @@ runs:
- name: 📊 显示缓存命中状态
run: |
echo "cache-hit: ${{ steps.cache-pnpm-restore.outputs.cache-hit }}"
echo "cache-hit: ${{ steps.cache-pnpm-restore.outputs.cache-hit }}"
shell: bash
- id: cache-pnpm-save
if: always() && steps.cache-pnpm-restore.outputs.cache-hit == 'false'
if: always() && steps.cache-pnpm-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: ${{ steps.pnpm-store-dir.outputs.pnpmStoreDir }}
key: ${{ steps.cache-pnpm-restore.outputs.cache-primary-key }}
# # https://github.com/pnpm/pnpm/issues/7192#issuecomment-2353298966
# package-import-method=hardlink
# rm -r node_modules
# pnpm fetch
# pnpm install --offline