Merge pull request #36 from CadenBPurdue/bug-fix #111
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint code | |
on: | |
push: | |
branches: | |
- '**' | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '22' | |
- name: Install dependencies | |
run: npm install | |
- name: Run linter and try to fix issues | |
run: npm run lint:fix | |
- name: Commit changes | |
run: | | |
git config --local user.name "GitHub Action" | |
git config --local user.email "action@github.com" | |
git diff --exit-code || (git add . && git commit -m "Auto-format code using ESlint" && git push) | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |