← 返回
开发者工具 中文

gh-modify-pr

Modify code based on GitHub PR review comments and create a local commit using gh + git. Use when the user asks to "follow PR comments", "fix review comments...
根据 GitHub PR 审查意见修改代码,使用 gh + git 创建本地提交。用于用户要求“遵循 PR 评论”“修复审查评论”等场景。
danie1lin danie1lin 来源
开发者工具 clawhub v1.0.1 1 版本 99882.9 Key: 无需
★ 0
Stars
📥 853
下载
💾 3
安装
1
版本
#latest

概述

gh-modify-pr

Use this workflow for PR-comment-driven changes.

Inputs

  • PR URL (preferred), e.g. https://github.com/owner/repo/pull/123
  • Optional scope from user (e.g. only one comment, all unresolved comments)

Workflow

  1. Parse owner/repo and PR number from URL.
  2. Inspect PR summary:
    • gh pr view --json number,title,headRefName,baseRefName,files,reviews,reviewDecision
  3. Fetch inline review comments:
    • gh api repos///pulls//comments
  4. Extract actionable items from comment bodies.
  5. Ensure local repo exists in workspace:
    • If missing: git clone git@github.com:/.git
  6. Checkout PR branch in local repo:
    • gh pr checkout
  7. Open affected files and implement requested changes exactly.
  8. Validate changed files quickly (lint/test only if needed or requested).
  9. Commit:
    • git add
    • git commit -m ""
  10. Report back with:
    • What changed
    • Commit hash
    • Branch name
  11. Push only if user asks/approves:
    • git push

Rules

  • Prefer minimal diffs that address reviewer intent directly.
  • Do not silently alter unrelated code.
  • If a comment is ambiguous, ask one focused clarification question.
  • If no local repo exists, clone first instead of failing.
  • Include failed attempts in the final operation log when user asks for traceability.

Handy commands

# PR meta
gh pr view <url> --json number,title,headRefName,baseRefName,files,reviews,reviewDecision

# Inline review comments
gh api repos/<owner>/<repo>/pulls/<number>/comments

# Checkout PR branch (inside repo)
gh pr checkout <number>

# Status and commit
git status --short
git add <files>
git commit -m "chore: address PR review comments"

Output template

  • PR:
  • Addressed comments:
  • Changed files:
  • :
  • Commit:
  • Branch:
  • Pushed: yes/no

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-29 20:49 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 195 📥 67,422
dev-programming

Docker Essentials

arnarsson
核心 Docker 命令和工作流程,包括容器管理、镜像操作和调试。
★ 38 📥 32,240
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 72 📥 181,465