gh-review-requests

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GitHub Review Requests

GitHub审查请求

Fetch unread
review_requested
notifications for open (unmerged) PRs, filtered by a GitHub team.
Requires: GitHub CLI (
gh
) authenticated.
获取针对未合并(open)PR的未读
review_requested
通知,并按GitHub团队进行筛选。
要求:已完成GitHub CLI (
gh
)的身份验证。

Step 1: Identify the Team

步骤1:确定团队

If the user has not specified a team, ask:
Which GitHub team should I filter by? (e.g.
streaming-platform
)
Accept either a team slug (
streaming-platform
) or a display name ("Streaming Platform") — convert to lowercase-hyphenated slug before passing to the script.
如果用户未指定团队,请询问:
我应该按哪个GitHub团队进行筛选?(例如:
streaming-platform
接受团队别名(slug,如
streaming-platform
)或显示名称(如“Streaming Platform”)——在传入脚本前转换为小写连字符格式的别名。

Step 2: Run the Script

步骤2:运行脚本

bash
uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_review_requests.py --org getsentry --teams <team-slug>
To filter by multiple teams, pass a comma-separated list:
bash
uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_review_requests.py --org getsentry --teams <team slugs>
bash
uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_review_requests.py --org getsentry --teams <team-slug>
如需按多个团队筛选,请传入逗号分隔的列表:
bash
uv run ${CLAUDE_SKILL_ROOT}/scripts/fetch_review_requests.py --org getsentry --teams <team slugs>

Script output

脚本输出

json
{
  "total": 3,
  "prs": [
    {
      "notification_id": "12345",
      "title": "feat(kafka): add workflow to restart a broker",
      "url": "https://github.com/getsentry/ops/pull/19144",
      "repo": "getsentry/ops",
      "pr_number": 19144,
      "author": "bmckerry",
      "reasons": ["opened by: bmckerry"]
    }
  ]
}
reasons
will contain one or both of:
  • "review requested from: <Team Name>"
    — the team is a requested reviewer
  • "opened by: <login>"
    — the PR author is a team member
json
{
  "total": 3,
  "prs": [
    {
      "notification_id": "12345",
      "title": "feat(kafka): add workflow to restart a broker",
      "url": "https://github.com/getsentry/ops/pull/19144",
      "repo": "getsentry/ops",
      "pr_number": 19144,
      "author": "bmckerry",
      "reasons": ["opened by: bmckerry"]
    }
  ]
}
reasons
字段将包含以下一项或两项:
  • "review requested from: <Team Name>"
    — 该团队是被请求的审查方
  • "opened by: <login>"
    — PR的发起者是团队成员

Step 3: Present Results

步骤3:展示结果

Display results as a markdown table with full URLs:
#TitleURLReason
1feat(kafka): add workflow to restart a brokerhttps://github.com/getsentry/ops/pull/19144opened by: evanh
If
total
is 0, say: "No unread review requests found for that team."
将结果以Markdown表格形式展示,包含完整URL:
#标题URL原因
1feat(kafka): add workflow to restart a brokerhttps://github.com/getsentry/ops/pull/19144opened by: evanh
如果
total
为0,请回复:“未找到该团队的未读审查请求。”

Fallback

备选方案

If the script fails, run manually:
bash
gh api notifications --paginate
Then for each
review_requested
notification, check:
  • gh api repos/{repo}/pulls/{number}
    — skip if
    state == "closed"
    or
    merged_at
    is set
  • gh api repos/{repo}/pulls/{number}/requested_reviewers
    — check
    teams[].name
  • gh api orgs/{org}/teams/{slug}/members
    — check if author is a member
如果脚本运行失败,请手动执行以下命令:
bash
gh api notifications --paginate
然后针对每个
review_requested
通知,检查:
  • gh api repos/{repo}/pulls/{number}
    — 如果
    state == "closed"
    或已设置
    merged_at
    ,则跳过
  • gh api repos/{repo}/pulls/{number}/requested_reviewers
    — 检查
    teams[].name
  • gh api orgs/{org}/teams/{slug}/members
    — 检查发起者是否为团队成员