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 - 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 'github-tidy-bot@supabase.com' 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