diff --git a/.github/workflows/pr-win32-test.yml b/.github/workflows/pr-win32-test.yml index ceda82f998a12..44f7f606be32e 100644 --- a/.github/workflows/pr-win32-test.yml +++ b/.github/workflows/pr-win32-test.yml @@ -47,7 +47,10 @@ jobs: - name: Extract node_modules cache if: steps.node-modules-cache.outputs.cache-hit == 'true' shell: pwsh - run: '& "C:\Program Files\Git\usr\bin\tar.exe" -xf .build/node_modules_cache/cache.tzst -C . --force-local --use-compress-program "zstd -d"' + run: | + if (Test-Path .build/node_modules_cache/cache.tzst) { + & "C:\Program Files\Git\usr\bin\tar.exe" -xf .build/node_modules_cache/cache.tzst -C . --force-local --use-compress-program "zstd -d" + } - name: Install dependencies if: steps.node-modules-cache.outputs.cache-hit != 'true' diff --git a/build/azure-pipelines/win32/steps/product-build-win32-compile.yml b/build/azure-pipelines/win32/steps/product-build-win32-compile.yml index 39880ce784082..876a504785b54 100644 --- a/build/azure-pipelines/win32/steps/product-build-win32-compile.yml +++ b/build/azure-pipelines/win32/steps/product-build-win32-compile.yml @@ -65,7 +65,10 @@ steps: cacheHitVar: NODE_MODULES_RESTORED displayName: Restore node_modules cache - - powershell: '& "C:\Program Files\Git\usr\bin\tar.exe" -xf .build/node_modules_cache/cache.tzst -C . --force-local --use-compress-program "zstd -d"' + - powershell: | + if (Test-Path .build/node_modules_cache/cache.tzst) { + & "C:\Program Files\Git\usr\bin\tar.exe" -xf .build/node_modules_cache/cache.tzst -C . --force-local --use-compress-program "zstd -d" + } condition: and(succeeded(), eq(variables.NODE_MODULES_RESTORED, 'true')) displayName: Extract node_modules cache