Feat/auto ci fmt #1670
Workflow file for this run
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 | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| linter: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' | |
| cache: 'yarn' | |
| - name: Install project dependencies | |
| run: yarn install | |
| - name: Lint | |
| run: yarn nx format:check --all | |
| continue-on-error: true # Continue even if the check fails | |
| - name: Auto-format and commit changes if needed | |
| if: ${{ failure() }} | |
| run: | | |
| yarn nx format:write --all | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "[email protected]" | |
| git add . | |
| git commit -m "fmt" | |
| git push |