-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
34 lines (32 loc) · 1015 Bytes
/
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
name: Run Node/Yarn
description: Install Node/Yarn packages on development environment and run commands.
author: Manel Merino <[email protected]>, Roberto Welzel Filho <[email protected]>, Unai Abrisketa <[email protected]>
inputs:
node_version:
description: The node version to be used. Defaults to `18`.
required: true
default: '18'
cache_key:
description: The cache key to be checked. Can be one of `npm`, `yarn`. Defaults to `yarn`.
required: true
default: yarn
cmd:
description: The command to be executed.
required: true
runs:
using: composite
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node_version }}
cache: ${{ inputs.cache_key }}
- shell: bash
run: |
if [ "${{ inputs.cache_key }}" -eq 'npm' ]; then
npm install --production=false
else
yarn install --production=false
fi
- shell: bash
run: ${{ inputs.cmd }}