-
Notifications
You must be signed in to change notification settings - Fork 5
49 lines (36 loc) · 961 Bytes
/
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
40
41
42
43
44
45
46
name: Lint
on:
push:
branches:
- main
pull_request:
permissions:
checks: write
contents: write
jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '14'
- name: Install dependencies
run: npm install
- name: Run linters
run: |
./node_modules/.bin/eslint --ext .js,.vue src --fix
# Check if there are any changes
git diff --exit-code || {
# Configure Git user
git config user.name "Lint Bot"
git config user.email "[email protected]"
# Commit the changes
git add .
git commit -m "Auto-fix linting issues"
# Push the changes back to the current branch
git push
}