name: LLM Code Review

permissions:
  contents: read
  pull-requests: write

on:
  pull_request:
    types: [opened, reopened, synchronize]

jobs:
  llm-code-review:
    runs-on: ubuntu-latest
    steps:
      - uses: fit2cloud/LLM-CodeReview-Action@main
        env:
          GITHUB_TOKEN: ${{ github.token }}
          OPENAI_API_KEY: ${{ secrets.ALIYUN_LLM_API_KEY }}
          LANGUAGE: Chinese
          OPENAI_API_ENDPOINT: https://dashscope.aliyuncs.com/compatible-mode/v1
          MODEL: qwen2.5-coder-3b-instruct
          PROMPT: "请检查以下代码差异是否存在任何不规范、潜在问题，提出优化建议，并以中文提供答案。"
          top_p: 1
          temperature: 1
          # max_tokens: 10000
          MAX_PATCH_LENGTH: 10000
          IGNORE_PATTERNS: "/node_modules,*.md,/dist,/.github"
          FILE_PATTERNS: "*.java,*.go,*.py,*.vue,*.ts,*.js,*.css,*.scss,*.html,*.yml,*.yaml"
