Back to list
BumgeunSong

fetching-pr-comments

by BumgeunSong

Writing App

6🍴 0📅 Jan 17, 2026

SKILL.md


name: fetching-pr-comments description: Use when needing to check PR review comments on current branch, before addressing reviewer feedback, or when asked to fetch/review PR comments

Fetching PR Comments

Overview

Retrieve and parse GitHub PR review comments for the current branch using gh CLI.

Quick Reference

TaskCommand
Check if PR existsgh pr view
View PR with issue commentsgh pr view --comments
Fetch review comments (code-level)gh api repos/{owner}/{repo}/pulls/{n}/comments
Extract key fields--jq '.[] | {path, line, body}'

Workflow

  1. Get PR number for current branch:

    gh pr view --json number --jq '.number'
    
  2. Fetch review comments:

    gh api repos/{owner}/{repo}/pulls/{n}/comments \
      --jq '.[] | {path: .path, line: .line, body: .body}'
    
  3. Full command (single step):

    gh api repos/OWNER/REPO/pulls/$(gh pr view --json number -q .number)/comments \
      --jq '.[] | {path: .path, line: .line, body: .body}'
    

Important Distinctions

TypeWhat it showsHow to get
Issue commentsPR-level discussiongh pr view --comments
Review commentsCode-level feedbackgh api .../pulls/{n}/comments

Common Patterns

Check if current branch has a PR:

gh pr view 2>/dev/null && echo "PR exists" || echo "No PR"

Get PR details + comments in one view:

gh pr view --comments

Fetch specific PR by number:

gh pr view 429 --repo owner/repo --comments

When NOT to Use

  • Creating new PRs (use gh pr create)
  • Reviewing diffs (use gh pr diff)
  • Merging (use gh pr merge)

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon