Skip to content

Commit

Permalink
feat: added upgrade-npm-version to setup action
Browse files Browse the repository at this point in the history
  • Loading branch information
prisis committed May 20, 2024
1 parent 2138464 commit f4c3ddf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions step/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ inputs:
description: "The node.js version to use"
required: false
default: "18"
upgrade-npm-version:
description: "The npm version to use"
required: false
default: "true"
npm-version:
description: "The npm version to use"
required: false
Expand Down Expand Up @@ -71,6 +75,7 @@ runs:

# @see: npm install -g npm@latest is necessary to make provenance available. More info: https://docs.npmjs.com/generating-provenance-statements
- name: "Upgrade npm to ${{ inputs.npm-version }} version"
if: "inputs.upgrade-npm-version == 'true'"
shell: "bash"
run: "npm install --global npm@${{ inputs.npm-version }}"
env:
Expand Down Expand Up @@ -159,3 +164,7 @@ runs:
if: "inputs.enable-node-modules-cache == 'true'"
shell: "bash"
run: "tar -cf - node_modules | lz4 > /tmp/node_modules.tar.lz4" # compress node_modules

- name: "npm v8.5+ requires workspaces-update to be set to false"
shell: "bash"
run: "echo 'workspaces-update=false' >> .npmrc"

0 comments on commit f4c3ddf

Please sign in to comment.