-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
40 lines (40 loc) · 1.13 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
name: "Run on Yarn"
description: "Composite GitHub Action to run a command with Yarn."
inputs:
command:
description: "Command to run"
required: true
node-version:
description: "Node Version"
default: 18
required: false
github-token:
description: "Github token to use when checking out the repo"
default: ${{ github.token }}
required: false
fetch-depth:
description: "Checkout depth"
default: 1
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
with:
token: ${{ inputs.github-token }}
fetch-depth: ${{ inputs.fetch-depth }}
- uses: actions/setup-node@v3
with:
cache: "yarn"
node-version: "${{ inputs.node-version }}"
- uses: actions/cache@v4
id: yarn-cache
with:
path: |
**/node_modules
!**/node_modules/.cache
key: ${{ runner.os }}-yarn-node-${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies If Not Cached
run: \[ -d node_modules \] || yarn install --frozen-lockfile
shell: bash
- run: yarn ${{ inputs.command }}
shell: bash