From 22d71e33ad70ed7b7c6efbced8dfea8a94a22707 Mon Sep 17 00:00:00 2001 From: Dylan Musil Date: Wed, 18 Mar 2020 22:05:56 -0400 Subject: [PATCH] Update Node Windows example to find the npm cache (#223) --- 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- ```