From 419bb7fe7682f4c844c0e45d2cec652e92f224e7 Mon Sep 17 00:00:00 2001 From: Dylan Musil Date: Wed, 18 Mar 2020 18:29:44 -0400 Subject: [PATCH] Update Node Windows example to find the npm cache --- examples.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples.md b/examples.md index 8ed05a9..7b906f8 100644 --- a/examples.md +++ b/examples.md @@ -140,10 +140,14 @@ For npm, cache files are stored in `~/.npm` on Posix, or `%AppData%/npm-cache` o ### Windows ```yaml +- name: Get npm cache directory + id: npm-cache + run: | + echo "::set-output name=dir::$(npm config get cache)" - uses: actions/cache@v1 with: - path: ~\AppData\Roaming\npm-cache - key: ${{ runner.os }}-node-${{ hashFiles('**\package-lock.json') }} + path: ${{ steps.npm-cache.outputs.dir }} + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- ```