feat: AI 代码审查工作流(DeepSeek,类 Copilot,自付额度) - #768
Open
PtJade-Ceramic wants to merge 1 commit into
Open
Conversation
- .github/workflows/ai-review.yml:pull_request 自动审 + /review + workflow_dispatch + schedule 轮询 - script/ai_review.py:拉取 PR diff → 调用 DeepSeek → 生成中文结构化审查 - docs/ai-review.md:使用/安全说明 设计要点: - 各用户在自己的 fork 自建实例,配置自己的 LLM_API_KEY(每次审查自付额度,上游仓库不存任何密钥) - 可配置 GitHub App,以机器人身份(如 gh-chinese-ai-reviewer[bot])发布审查,不占用用户账号 - 安全模型:明文只在用户侧;不使用 pull_request_target;模型输出仅当文本不执行
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
简介
新增一个"类 Copilot"的 AI 代码审查工作流:任何用户可以自动或按需请求 DeepSeek 对 PR 进行中文代码审查,审查以机器人身份发布,每次审查消耗请求者自己的 DeepSeek 额度,本仓库不保存任何密钥明文。
变更内容
.github/workflows/ai-review.ymlpull_request打开/更新时自动审查/review按需审查workflow_dispatch手动指定仓库+PRschedule轮询「看护清单」中的上游 PR,响应本仓库属主的/reviewscript/ai_review.py:拉取 PR diff → 读取.github/copilot-instructions.md(强制中文)→ 调用 DeepSeek → 输出结构化审查(概览/问题分级/优点/重写建议)docs/ai-review.md:使用与安全模型说明设计要点与安全模型
LLM_API_KEY只存在于用户自己的 fork secret;每次审查只花触发者自己的 DeepSeek 额度。上游仓库不存任何密钥。github-actions[bot]发布;配置 GitHub App 后以机器人(如gh-chinese-ai-reviewer[bot])发布,不占用用户账号。pull_request_target;模型输出仅作为文本渲染,不执行。已知限制
/review为轮询(约 15 分钟),非即时。pull_request事件读不到 secrets → fork 内自动审需把工作流放到 fork 默认分支。验证
已在 fork
PtJade-Ceramic/github-chinese端到端验证:自动审、/review、workflow_dispatch、去重、github-actions[bot]与gh-chinese-ai-reviewer[bot]发布均通过。