AlexStocks commented on issue #878: URL: https://github.com/apache/incubator-seata-go/issues/878#issuecomment-3261114502
GPT 回复: ```markdown 可以的 👍 群里如果只想用 **免费的**,又能在 **GitHub Action 里配置自动触发 code review**,其实已经有不少开源项目。整理几个常见的: --- ## 🚀 免费 + GitHub Action 可用的 AI Code Review 工具 ### 1. **PR-Agent (CodiumAI 出品的开源版)** * **地址**: [[CodiumAI/pr-agent](https://github.com/CodiumAI/pr-agent)](https://github.com/CodiumAI/pr-agent) * **特点**: * 完全开源,支持 GitHub Action 直接配置 * 在 PR 评论里输入 `/review`、`/improve` 就能触发 GPT 生成评审意见 * 也支持自动触发模式 * **成本**: 免费(需要自己提供 OpenAI API Key) --- ### 2. **[microsoft/gpt-review](https://github.com/microsoft/gpt-review)** * **地址**: [microsoft/gpt-review](https://github.com/microsoft/gpt-review) * **特点**: * 微软官方项目,支持 GitHub Action 或 CLI * 能分析 PR diff,并输出建议评论 * 支持 OpenAI / Azure OpenAI * **成本**: 免费(同样需要 API Key) --- ### 3. **[agogear/chatgpt-pr-review](https://github.com/agogear/chatgpt-pr-review)** * **地址**: [agogear/chatgpt-pr-review](https://github.com/agogear/chatgpt-pr-review) * **特点**: * 专门做成 GitHub Action 的 AI PR Review 工具 * 每次有人提 PR,Action 会跑一遍,把结果直接写成 PR 评论 * **成本**: 免费(依赖 OpenAI API Key) --- ### 4. **[cirolini/genai-code-review](https://github.com/cirolini/genai-code-review)** * **地址**: [cirolini/genai-code-review](https://github.com/cirolini/genai-code-review) * **特点**: * 也是 GitHub Action 插件 * 支持配置模型(如 GPT-3.5、GPT-4) * 会自动生成 review 评论,贴在 PR 下面 * **成本**: 免费(需要 API Key) --- ## ⚡ 总结 如果你要在群里推荐: * **最活跃/成熟的**:`PR-Agent` * **官方背景的**:`microsoft/gpt-review` * **上手最简单的**:`agogear/chatgpt-pr-review` 或 `genai-code-review` 它们都是开源免费的,只是 **调用 GPT 时要自己出 API Key 的费用**。 --- 写一个最小化的 GitHub Action 配置 yml,假设你用的是 PR-Agent 或类似工具(比如 cirolini/genai-code-review),只要能设置 secret(OPENAI_API_KEY)就能跑。 比如最简的例子(放到 .github/workflows/pr-review.yml): name: AI PR Review on: pull_request: types: [opened, synchronize, reopened] jobs: pr-review: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - name: Run AI PR Review uses: cirolini/[email protected] with: openai_api_key: ${{ secrets.OPENAI_API_KEY }} model: gpt-3.5-turbo temperature: 0.2 🔑 使用说明 在 GitHub 仓库 Settings > Secrets and variables > Actions 里配置: OPENAI_API_KEY(你的 OpenAI key 或 Azure OpenAI key)。 每次有人新建或更新 PR 时,Action 会自动触发。 运行后,它会把 GPT 的 review 评论直接写到 PR 下面。 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
