forked from paypal-examples/docs-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (32 loc) · 930 Bytes
/
validate.yml
File metadata and controls
35 lines (32 loc) · 930 Bytes
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
name: validate
on:
# run on push but only for the main branch
push:
branches:
- main
# run for every pull request
pull_request: {}
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: 🧹 Check code formatting with Prettier
run: >
find . -name package.json -maxdepth 2 -type f | while read -r file; do
directory=$(dirname "$file")
cd "$directory" && npm run format:check && cd -
done
- name: 👕 Lint code with ESLint
run: >
find . -name package.json -maxdepth 3 -type f | while read -r file; do
directory=$(dirname "$file")
cd "$directory" && npm run lint && cd -
done