mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
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: pnpm/action-setup@v4
|
|
name: Install pnpm
|
|
with:
|
|
run_install: false
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
|
|
- name: Install required dependencies
|
|
run: pnpm i
|
|
|
|
- name: Run Prettier in fix mode
|
|
run: pnpm 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
|