8000 chore: use yarn cache instead of npm cache · cloudgraphdev/cli@c1704c2 · GitHub
[go: up one dir, main page]

Skip to content

Commit c1704c2

Browse files
committed
chore: use yarn cache instead of npm cache
1 parent 6791151 commit c1704c2

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,23 @@ jobs:
2323
registry-url: "https://registry.npmjs.org"
2424

2525
- name: Get cache directory
26-
id: npm-cache-dir
26+
id: yarn-cache-dir
2727
run: |
28-
echo "::set-output name=dir::$(npm config get cache)"
29-
28+
echo "::set-output name=dir::$(yarn cache dir)"
29+
3030
- name: Restoring cache
31-
uses: actions/cache@v2
32-
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
31+
uses: actions/cache@v3
32+
id: yarn-cache # use this to check for `cache-hit` ==> if: steps.yarn-cache.outputs.cache-hit != 'true'
3333
with:
34-
path: ${{ steps.npm-cache-dir.outputs.dir }}
34+
path: ${{ steps.yarn-cache-dir.outputs.dir }}
3535
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
3636
restore-keys: |
3737
${{ runner.os }}-yarn-
3838
3939
- name: Install Packages
40-
run: yarn install --frozen-lockfile --cache-folder .npm --prefer-offline
40+
# NOTE: The --ignore-scripts flag is required to prevent leakage of NPM_TOKEN value
41+
# See https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#use-private-packages
42+
run: yarn install --frozen-lockfile --prefer-offline --ignore-scripts
4143

4244
- name: Build
4345
run: yarn prepack

0 commit comments

Comments
 (0)
0