在GitHub项目中配置PR-Agent实现自动化审查需要以下步骤:
1. Basic configuration
- 在GitHub Marketplace添加Qodo Merge应用
- 授予应用访问目标仓库的权限
- In the project root directory, create the
.pr_agent.toml
configuration file
2. 触发方式配置
- manual trigger:在任何PR评论中输入
@pr-agent analyze
isometric instruction - automatic trigger: in
.github/workflows/
下创建workflow文件,配置PR创建/更新事件触发条件
3. 规则定制
- 在配置文件中设置检查标准(如复杂度阈值)
- 定义反馈模板和严重等级划分
- 配置忽略规则(如对特定文件/目录不检查)
Typical Configuration Example:
[analysis] min_confidence = 0.7 check_security = true [output] format = "markdown" show_snippets = true
配置完成后,系统会在每次PR创建时自动运行分析,并将结果以Markdown评论形式呈现在PR讨论区。
This answer comes from the articlePR Agent: automated pull request analysis toolThe