From b1604340a8bde5d1fda8cdefd39e275bf3749b7e Mon Sep 17 00:00:00 2001 From: Refringe Date: Fri, 3 Jan 2025 17:17:23 -0500 Subject: [PATCH] Dynamically fetch the npm cache directory --- .github/workflows/build.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8d0d7fa..07f2df7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -219,12 +219,17 @@ jobs: cache: "npm" cache-dependency-path: "SPT/Build/server/project/package.json" + - name: Get npm cache directory + id: npm-cache-dir + shell: pwsh + run: echo "dir=$(npm config get cache)" >> ${env:GITHUB_OUTPUT} + - name: Check NPM Cache id: cache-check uses: actions/cache@v4 with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('SPT/Build/server/project/package.json') }} + path: ${{ steps.npm-cache-dir.outputs.dir }} + key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }} restore-keys: | ${{ runner.os }}-node-