Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions actions/setup-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ inputs:
description: "The token to use for checkout"
required: false
default: ${{ github.token }}
cache:
description: "Whether to restore and save the package manager cache. Set to false in jobs that publish or hold secrets, so a poisoned cache can't reach them"
required: false
default: "true"

runs:
using: "composite"
Expand Down Expand Up @@ -60,15 +64,17 @@ runs:
with:
node-version-file: ".nvmrc"
registry-url: ${{ inputs.registry-url }}
cache: ${{ inputs.pnpm == 'true' && 'pnpm' || 'npm' }}
cache: ${{ inputs.cache == 'true' && (inputs.pnpm == 'true' && 'pnpm' || 'npm') || '' }}
package-manager-cache: ${{ inputs.cache == 'true' }}

- name: Setup Node.js (with specified version)
if: inputs.use-version-file != 'true'
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ inputs.node-version }}
registry-url: ${{ inputs.registry-url }}
cache: ${{ inputs.pnpm == 'true' && 'pnpm' || 'npm' }}
cache: ${{ inputs.cache == 'true' && (inputs.pnpm == 'true' && 'pnpm' || 'npm') || '' }}
package-manager-cache: ${{ inputs.cache == 'true' }}

- name: Install dependencies with pnpm
if: inputs.pnpm == 'true'
Expand Down
Loading