您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

autofix.yml 860B

12345678910111213141516171819202122232425262728293031
  1. name: autofix.ci
  2. on:
  3. workflow_call:
  4. pull_request:
  5. push:
  6. branches: [ "main" ]
  7. permissions:
  8. contents: read
  9. jobs:
  10. autofix:
  11. if: github.repository == 'langgenius/dify'
  12. runs-on: ubuntu-latest
  13. steps:
  14. - uses: actions/checkout@v4
  15. # Use uv to ensure we have the same ruff version in CI and locally.
  16. - uses: astral-sh/setup-uv@7edac99f961f18b581bbd960d59d049f04c0002f
  17. - run: |
  18. cd api
  19. uv sync --dev
  20. # Fix lint errors
  21. uv run ruff check --fix-only .
  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. - uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27