use linter action

This commit is contained in:
hobbes7878 2024-08-21 17:05:39 +01:00
parent f0fd04c2a6
commit aa47481f1e

View file

@ -7,6 +7,10 @@ on:
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
checks: write
contents: write
jobs:
lint:
name: Lint
@ -15,8 +19,6 @@ jobs:
- id: checkout
name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: setup-node
name: Setup Node.JS
@ -28,22 +30,11 @@ jobs:
- id: install-deps
name: Install dependencies
run: npm ci
- id: lint
name: Lint code
run: npm run lint
- id: format
name: Format code
run: npm run format
- id: commit_and_push
name: Commit and push formatted code
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit --allow-empty -m "lint and format"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- id: run-linters
name: Run linters
uses: wearerequired/lint-action@v2
with:
auto_fix: true
eslint: true
prettier: true