Pr Threads Resolve

posit-dev/skills/github/pr-threads-resolve

作者 posit-deve20b71b2ab527b7c480f4f60dcce2b18df1a99aeMIT收录于 2026年10月9日更新于 2026年10月9日

Bulk resolve unresolved PR review threads on the current branch’s PR — typically after threads have been addressed manually or via /pr-threads-address

AI 生成的概览

使用 gh CLI 批量解决当前分支 PR 上未解决的评审线程。

功能
该技能提供一套工作流,用于解决当前分支拉取请求上未解决的评审线程。它先查找 PR 编号和仓库标识,然后列出未解决线程及其文件、行号和评论内容,请求确认或允许选择性解决,解决已确认的线程,并汇报解决摘要。它依赖 gh CLI 和 gh-pr-review 扩展,并给出列出、解决及批量解决线程的示例命令。
适用场景
当拉取请求上的评审线程已通过手动方式或相关流程处理完毕,现在需要将其标记为已解决时使用。它适用于对当前分支 PR 上未解决的评审线程进行批量清理。
运行要求
需要 gh CLI 和 gh-pr-review 扩展(通过 gh extension install agynio/gh-pr-review 安装)。需要访问 GitHub 的网络连接。该技能不附带脚本,仅为说明文档。

Prerequisites

gh pr-review extension

Before using this command, check if the gh pr-review extension is installed:

bash
gh extension list | grep -q pr-review || gh extension install agynio/gh-pr-review

Resolve PR context first

Every gh pr-review subcommand requires both --pr <number> and --repo <owner/repo> — do not omit either. Look the values up once at the start of the workflow and substitute the literal numbers and slugs into every later command.

Get the PR number for the current branch:

bash
gh pr view --json number -q .number

Get the repository slug:

bash
gh repo view --json nameWithOwner -q .nameWithOwner

Then pass the resulting values directly — e.g. --pr 42 --repo posit-dev/skills — on every subsequent gh pr-review call in this workflow (list, resolve, view, reply).

Workflow

  1. Fetch and display all unresolved PR review threads
  2. Show thread details (file, line, comment text)
  3. Ask for confirmation or allow selective resolution
  4. Resolve the confirmed threads
  5. Report back with a summary of resolved threads

CLI Reference

List Review Threads

bash
gh pr-review threads list --pr <number> --repo <owner/repo>

Filter with --unresolved or --resolved.

Resolve / Unresolve Threads

bash
gh pr-review threads resolve --thread-id <PRRT_...> --pr <number> --repo <owner/repo>gh pr-review threads unresolve --thread-id <PRRT_...> --pr <number> --repo <owner/repo>

Bulk Resolve Example

Substitute the actual PR number and repo slug resolved in "Resolve PR context first" — the 42 / owner/repo below are placeholders.

bash
gh pr-review threads list --pr 42 --unresolved --repo owner/repo | \  jq -r '.threads[].id' | \  xargs -I {} gh pr-review threads resolve --thread-id {} --pr 42 --repo owner/repo

来源与署名

来源:posit-dev/skills位于github/pr-threads-resolve提交e20b71b

许可证: MIT

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架