[pull] master from supabase:master #21
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: Autofix Linting Checks | |
| on: | |
| pull_request: | |
| types: | |
| - labeled | |
| permissions: | |
| contents: write | |
| # Cancel old builds on new commit for same workflow + branch/PR | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| autofix: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event_name == 'pull_request' && (github.event.label.name == 'autofix') }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| sparse-checkout: apps | |
| ref: ${{ github.head_ref }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Install required dependencies | |
| run: npm ci | |
| - name: Run Prettier in fix mode | |
| run: npm run format | |
| - name: Commit changes and push to existing branch | |
| run: | | |
| git config --global user.name 'github-tidy-bot' | |
| git config --global user.email '[email protected]' | |
| if [[ `git status --porcelain` ]]; then | |
| echo "[bot] Changes detected, committing." | |
| echo "[bot] Running in non-squash mode." | |
| git commit -am "ci: Autofix updates from GitHub workflow" | |
| git push | |
| else | |
| echo "[bot] No changes detected, nothing to commit." | |
| fi |