address-github-comments

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Address GitHub Comments

处理GitHub评论

Overview

概述

Efficiently address PR review comments or issue feedback using the GitHub CLI (
gh
). This skill ensures all feedback is addressed systematically.
使用GitHub CLI(
gh
)高效处理PR评审评论或问题反馈。本技能可确保所有反馈都得到系统化处理。

Prerequisites

前置条件

Ensure
gh
is authenticated.
bash
gh auth status
If not logged in, run
gh auth login
.
确保
gh
已完成身份验证。
bash
gh auth status
如果未登录,请运行
gh auth login

Workflow

工作流程

1. Inspect Comments

1. 查看评论

Fetch the comments for the current branch's PR.
bash
gh pr view --comments
Or use a custom script if available to list threads.
获取当前分支PR的评论。
bash
gh pr view --comments
或者使用可用的自定义脚本列出评论线程。

2. Categorize and Plan

2. 分类与规划

  • List the comments and review threads.
  • Propose a fix for each.
  • Wait for user confirmation on which comments to address first if there are many.
  • 列出评论和评审线程。
  • 为每条评论提出修复方案。
  • 如果评论数量较多,等待用户确认优先处理哪些评论

3. Apply Fixes

3. 应用修复

Apply the code changes for the selected comments.
针对选定的评论进行代码修改。

4. Respond to Comments

4. 回复评论

Once fixed, respond to the threads as resolved.
bash
gh pr comment <PR_NUMBER> --body "Addressed in latest commit."
修复完成后,将线程标记为已解决并回复。
bash
gh pr comment <PR_NUMBER> --body "Addressed in latest commit."

Common Mistakes

常见错误

  • Applying fixes without understanding context: Always read the surrounding code of a comment.
  • Not verifying auth: Check
    gh auth status
    before starting.
  • 未理解上下文就应用修复:务必阅读评论所在的周边代码。
  • 未验证身份验证状态:开始操作前请检查
    gh auth status