Просмотр исходного кода

fix(ci): avoid actions/setup-node cache failure
`actions/setup-node@v4` requires pnpm cache directory to exist, or will
throw error in post-script:

```
Error: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.
```

The pnpm store directory won't be initialized without a `pnpm install`,
so manually create it to avoid this error.

Yuki Takei 9 месяцев назад
Родитель
Сommit
11d967dec8
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      .github/workflows/reusable-app-prod.yml

+ 6 - 0
.github/workflows/reusable-app-prod.yml

@@ -129,6 +129,12 @@ jobs:
         node-version: ${{ inputs.node-version }}
         cache: 'pnpm'
 
+    # avoid setup-node cache failure; see: https://github.com/actions/setup-node/issues/1137
+    - name: Verify PNPM Cache Directory
+      run: |
+        PNPM_STORE_PATH="$( pnpm store path --silent )"
+        [ -d "$PNPM_STORE_PATH" ] || mkdir -vp "$PNPM_STORE_PATH"
+
     - name: Download production files artifact
       uses: actions/download-artifact@v4
       with: