-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
70 lines (64 loc) · 1.89 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: "Setup node and pnpm"
author: "Dafnik"
description: "Setup node, pnpm and the caching"
branding:
icon: 'arrow-down-circle'
color: 'purple'
inputs:
pnpm:
description: "PNPM version"
required: false
default: '8'
node:
description: "Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0."
required: false
default: '20'
node-file:
description: 'File containing the version Spec of the version to use. Examples: .nvmrc, .node-version, .tool-versions.'
required: false
default: ''
cwd:
description: "Work directory"
required: false
default: "."
install:
description: "Runs pnpm install"
required: false
default: "false"
install-ignore-scripts:
description: "Runs pnpm install --ignore-scripts"
required: false
default: "false"
runs:
using: "composite"
steps:
- name: use pnpm ${{ inputs.pnpm }}
uses: pnpm/action-setup@v3
with:
version: ${{ inputs.pnpm }}
- name: use Node.js ${{ inputs.node }}
if: "${{ inputs.node-file == '' }}"
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node }}
cache: "pnpm"
cache-dependency-path: "${{ inputs.cwd }}/pnpm-lock.yaml"
- name: use Node.js ${{ inputs.node }}
if: "${{ inputs.node-file != '' }}"
uses: actions/setup-node@v4
with:
node-version-file: "${{ inputs.cwd }}/${{ inputs.node-file }}"
cache: "pnpm"
cache-dependency-path: "${{ inputs.cwd }}/pnpm-lock.yaml"
- name: Run pnpm install
if: "${{ inputs.install == 'true' }}"
shell: bash
run: |
cd ${{ inputs.cwd }}
pnpm install --frozen-lockfile
- name: Run pnpm install --ignore-scripts
if: "${{ inputs.install-ignore-scripts == 'true' }}"
shell: bash
run: |
cd ${{ inputs.cwd }}
pnpm install --frozen-lockfile --ignore-scripts