gh-address-comments

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

PR Comment Handler

PR评论处理指南

Guide to find the open PR for the current branch and address its comments with gh CLI. Run all
gh
commands with elevated network access.
Prereq: ensure
gh
is authenticated (for example, run
gh auth login
once), then run
gh auth status
with escalated permissions (include workflow/repo scopes) so
gh
commands succeed. If sandboxing blocks
gh auth status
, rerun it with
sandbox_permissions=require_escalated
.
本指南介绍如何使用gh CLI查找当前分支的公开PR并处理其评论。所有
gh
命令请使用提升的网络权限运行。
前提条件:确保
gh
已完成身份验证(例如,运行一次
gh auth login
),然后使用提升的权限运行
gh auth status
(需包含workflow/repo权限范围),以保证
gh
命令可成功执行。如果沙箱环境阻止了
gh auth status
的运行,请使用
sandbox_permissions=require_escalated
参数重新运行该命令。

1) Inspect comments needing attention

1) 查看需要处理的评论

  • Run scripts/fetch_comments.py which will print out all the comments and review threads on the PR
  • 运行scripts/fetch_comments.py脚本,该脚本会打印出PR上的所有评论和评审线程

2) Ask the user for clarification

2) 向用户确认处理范围

  • Number all the review threads and comments and provide a short summary of what would be required to apply a fix for it
  • Ask the user which numbered comments should be addressed
  • 为所有评审线程和评论编号,并简要说明修复每条评论所需的操作
  • 询问用户需要处理哪些编号的评论

3) If user chooses comments

3) 若用户选定评论

  • Apply fixes for the selected comments
Notes:
  • If gh hits auth/rate issues mid-run, prompt the user to re-authenticate with
    gh auth login
    , then retry.
  • 为选中的评论对应的问题应用修复
注意事项:
  • 如果在运行过程中gh遇到身份验证或速率限制问题,请提示用户使用
    gh auth login
    重新进行身份验证,然后重试。