faq updated #235
This file contains hidden or 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 workflow | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| permissions: | |
| contents: write | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Use Node.js 21.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 21.x | |
| - name: Cache node modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node-modules- | |
| - name: 🧰 Install Deps | |
| run: npm install | |
| - name: Run Lint | |
| run: npm run lint -- --fix --max-warnings=20 | |
| - name: Commit and Push Changes | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git checkout ${{ github.head_ref }} | |
| git add . | |
| git diff --staged --quiet || (git commit -m "chore: Auto-fix linting issues" && git push origin ${{ github.head_ref }}) |