47 lines
894 B
YAML
47 lines
894 B
YAML
name: ESLint Auto Fix
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- "**/*.js"
|
|
- "**/*.jsx"
|
|
- "**/*.ts"
|
|
- "**/*.tsx"
|
|
pull_request:
|
|
paths:
|
|
- "**/*.js"
|
|
- "**/*.jsx"
|
|
- "**/*.ts"
|
|
- "**/*.tsx"
|
|
|
|
jobs:
|
|
eslint:
|
|
runs-on: ubuntu-latest
|
|
if: github.actor != 'github-actions[bot]'
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
|
|
- name: Install deps
|
|
run: npm install
|
|
|
|
#- name: Prettier whitespace fix
|
|
# run: npx prettier --write "**/*.{js,ts}"
|
|
|
|
- name: ESLint auto-fix
|
|
run: npx eslint . --fix
|
|
|
|
- uses: stefanzweifel/git-auto-commit-action@v5
|
|
with:
|
|
commit_message: "chore: eslint auto-fix"
|
|
branch: ${{ github.head_ref || github.ref_name }}
|