-
Notifications
You must be signed in to change notification settings - Fork 41
39 lines (38 loc) · 1.12 KB
/
lint.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
name: 'npm lint'
on:
pull_request:
workflow_dispatch:
paths:
- 'src/modules/**.js'
- 'src/resources/js/**.js'
- 'src/resources/postcss/**.pcss'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
# ------------------------------------------------------------------------------
# Setup Node.
# ------------------------------------------------------------------------------
- name: Check for .nvmrc file
id: check-nvmrc
run: |
if [ -f "${{ github.workspace }}/.nvmrc" ]; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- uses: actions/setup-node@v4
if: steps.check-nvmrc.outputs.exists == 'true'
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Install node modules
run: npm ci
- name: Run linting tasks
run: npm run lint