You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

autofix.yml 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. name: autofix.ci
  2. on:
  3. pull_request:
  4. branches: ["main"]
  5. permissions:
  6. contents: read
  7. jobs:
  8. autofix:
  9. if: github.repository == 'langgenius/dify'
  10. runs-on: ubuntu-latest
  11. steps:
  12. - uses: actions/checkout@v4
  13. # Use uv to ensure we have the same ruff version in CI and locally.
  14. - uses: astral-sh/setup-uv@v6
  15. with:
  16. python-version: "3.12"
  17. - run: |
  18. cd api
  19. uv sync --dev
  20. # Fix lint errors
  21. uv run ruff check --fix .
  22. # Format code
  23. uv run ruff format .
  24. - name: ast-grep
  25. run: |
  26. uvx --from ast-grep-cli sg --pattern 'db.session.query($WHATEVER).filter($HERE)' --rewrite 'db.session.query($WHATEVER).where($HERE)' -l py --update-all
  27. uvx --from ast-grep-cli sg --pattern 'session.query($WHATEVER).filter($HERE)' --rewrite 'session.query($WHATEVER).where($HERE)' -l py --update-all
  28. - name: mdformat
  29. run: |
  30. uvx mdformat .
  31. - name: Install pnpm
  32. uses: pnpm/action-setup@v4
  33. with:
  34. package_json_file: web/package.json
  35. run_install: false
  36. - name: Setup NodeJS
  37. uses: actions/setup-node@v4
  38. with:
  39. node-version: 22
  40. cache: pnpm
  41. cache-dependency-path: ./web/package.json
  42. - name: Web dependencies
  43. working-directory: ./web
  44. run: pnpm install --frozen-lockfile
  45. - name: oxlint
  46. working-directory: ./web
  47. run: |
  48. pnpx oxlint --fix
  49. - uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27