fetching-pr-comments
Original:🇺🇸 English
Translated
Use when needing to check PR review comments on current branch, before addressing reviewer feedback, or when asked to fetch/review PR comments
1installs
Added on
NPX Install
npx skill4agent add bumgeunsong/daily-writing-friends fetching-pr-commentsTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Fetching PR Comments
Overview
Retrieve and parse GitHub PR review comments for the current branch using CLI.
ghQuick Reference
| Task | Command |
|---|---|
| Check if PR exists | |
| View PR with issue comments | |
| Fetch review comments (code-level) | |
| Extract key fields | |
Workflow
-
Get PR number for current branch:bash
gh pr view --json number --jq '.number' -
Fetch review comments:bash
gh api repos/{owner}/{repo}/pulls/{n}/comments \ --jq '.[] | {path: .path, line: .line, body: .body}' -
Full command (single step):bash
gh api repos/OWNER/REPO/pulls/$(gh pr view --json number -q .number)/comments \ --jq '.[] | {path: .path, line: .line, body: .body}'
Important Distinctions
| Type | What it shows | How to get |
|---|---|---|
| Issue comments | PR-level discussion | |
| Review comments | Code-level feedback | |
Common Patterns
Check if current branch has a PR:
bash
gh pr view 2>/dev/null && echo "PR exists" || echo "No PR"Get PR details + comments in one view:
bash
gh pr view --commentsFetch specific PR by number:
bash
gh pr view 429 --repo owner/repo --commentsWhen NOT to Use
- Creating new PRs (use )
gh pr create - Reviewing diffs (use )
gh pr diff - Merging (use )
gh pr merge