Skip to content

Commit 0c33f71

Browse files
committed
Added lint pipeline
1 parent 01eed21 commit 0c33f71

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/lint.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Lint Code
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
# Sets up Node.js environment
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: '20'
23+
24+
# Installs dependencies
25+
- name: Install dependencies
26+
run: npm install
27+
28+
# Runs ESLint
29+
- name: Run ESLint
30+
run: npx eslint --fix ./src
31+
32+
# Displays result
33+
- name: Check for ESLint errors
34+
run: |
35+
if npx eslint --fix ./src; then
36+
echo "Linting passed!"
37+
else
38+
echo "Linting failed!"
39+
exit 1
40+
fi

0 commit comments

Comments
 (0)