From 9ab449797deda9d3c02d582def9c8eaec342e943 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Wed, 30 Mar 2022 08:48:37 -0700 Subject: [PATCH] feat: add lockfile option to control npmrc and ci cache --- lib/content/index.js | 1 + lib/content/npmrc | 2 +- lib/content/setup-node.yml | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/content/index.js b/lib/content/index.js index a80d2ee6..dcd26b4f 100644 --- a/lib/content/index.js +++ b/lib/content/index.js @@ -69,6 +69,7 @@ module.exports = { branches: ['main', 'latest'], distPaths: ['bin/', 'lib/'], ciVersions: ['12.13.0', '12.x', '14.15.0', '14.x', '16.0.0', '16.x'], + lockfile: false, unwantedPackages: [ 'eslint', 'eslint-plugin-node', diff --git a/lib/content/npmrc b/lib/content/npmrc index 43c97e71..239fb98e 100644 --- a/lib/content/npmrc +++ b/lib/content/npmrc @@ -1 +1 @@ -package-lock=false +package-lock={{lockfile}} diff --git a/lib/content/setup-node.yml b/lib/content/setup-node.yml index 5b393d33..7516e63b 100644 --- a/lib/content/setup-node.yml +++ b/lib/content/setup-node.yml @@ -1,6 +1,9 @@ - uses: actions/setup-node@v3 with: node-version: {{#if useMatrix}}$\{{ matrix.node-version }}{{else}}{{#each ciVersions}}{{#if @last}}{{.}}{{/if}}{{/each}}{{/if}} + {{#if lockfile}} + cache: npm + {{/if}} {{#if useMatrix}} - name: Update to workable npm (windows) # node 12 and 14 ship with npm@6, which is known to fail when updating itself in windows