name: autofix.ci

on:
  pull_request:
  push:
    branches:
      - main

permissions:
  contents: read

jobs:
  autofix:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-python@v5
        with:
          python-version-file: .github/python-version.txt
      - run: pip install -e .[dev]
      - run: ruff check --fix-only .
      - run: ruff format .

      - run: web/gen/all

      - uses: actions/setup-node@v4
        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@ff86a557419858bb967097bfc916833f5647fa8c
