name: autofix.ci

on:
  pull_request:
  push:
    branches:
      - main

permissions:
  contents: read

jobs:
  autofix:
    runs-on: ubuntu-latest
    steps:
      - uses: mhils/workflows/checkout@8fe88b311a66c441e01edfebe4cd90d8a47fa335
      - uses: mhils/workflows/setup-uv@8fe88b311a66c441e01edfebe4cd90d8a47fa335

      - run: uv lock

      - uses: mhils/workflows/uv-sync@8fe88b311a66c441e01edfebe4cd90d8a47fa335

      - run: ruff check --fix-only .
      - run: ruff format .

      - run: web/gen/all

      - uses: actions/setup-node@v6.3.0
        with:
          node-version-file: .github/node-version.txt
      - run: npm ci
        working-directory: web
      - run: npm run eslint
        working-directory: web
        continue-on-error: true
      - run: npm run prettier
        working-directory: web

      - uses: mhils/add-pr-ref-in-changelog@main

      - uses: autofix-ci/action@7a166d7532b277f34e16238930461bf77f9d7ed8
