跳转到内容

GitHub Action

这一页介绍 GitHub Pull Request 中显示的 PR Report。如果你只想先完成本地 CLI setup,请从 安装 开始;当需要让 reviewer 看到 Agent Note summary 时再回到这里。

在你的仓库里先执行一次:

Terminal window
npx agent-note init --agent claude

这样会为你创建 PR 报告 workflow:

.github/workflows/agentnote-pr-report.yml
name: Agent Note PR Report
on:
pull_request:
types: [opened, reopened, synchronize]
permissions:
contents: read
pull-requests: write
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: wasabeef/AgentNote@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

这样就完成了。每个 PR 都会得到一份 AI 会话报告。

InputDefault说明
basePR 的 base branch用于比较的分支
pr_outputdescriptionPR 报告的输出位置:descriptioncommentnone
prompt_detailcompactPR 报告中 prompt 历史的详细程度:compact 保持报告聚焦,full 显示所有已保存 prompt
dashboardfalse运行 Dashboard Mode,而不是 PR Report Mode。通常由 agent-note init --dashboard 生成
Terminal window
npx agent-note init --agent claude --dashboard
Output类型说明
overall_ai_rationumber整个 PR 的 AI Ratio (0-100)
overall_methodstringlinefilemixednone
tracked_commitsnumber带有 agent-note 数据的 commit 数
total_commitsnumberPR 中的 commit 总数
total_promptsnumber所有 commit 的 prompt 总数
jsonstring完整的结构化报告
markdownstring已渲染的 Markdown 报告
should_deployboolean stringDashboard Mode 输出,用来告诉调用方 workflow 是否需要发布 Pages

PR 报告包含:

  • HeaderTotal AI Ratio 与进度条,以及下一行的 Model
  • Reviewer Context — 面向 AI Review tool 的 hidden Markdown comment,由通用 changed area 分组、review focus 和最新相关 intent signals 生成
  • 表格 — 每个 commit 的 AI Ratio、prompt 数和文件列表
  • Prompts — 可折叠的 📝 Context🧑 Prompt🤖 Response 区块

Reviewer Context 会作为 hidden Markdown comment 保存在 PR body 中。人类 reviewer 只会看到普通报告,而读取 raw PR description 的工具可以使用这段额外 context。

这段 context 是确定性生成的。它会从 Agent Note data 中总结 changed area、review focus 和最近相关的 intent signals。Copilot、CodeRabbit、Devin、Greptile 等工具可以在阅读 diff 前先理解 PR 为什么发生变化。

它仍然只是指导,不是证明。review tool 应该把它和实际 diff、test、code 对照使用。

如果你还想要一个共享的 Pages 视图来查看 open 和 merged 的 PR 历史,请继续阅读 Dashboard