Skip to content

Instantly share code, notes, and snippets.

@ericzakariasson
Created May 29, 2025 22:49
Show Gist options
  • Save ericzakariasson/88ad4952e66fb79549d2a22d53e24c6b to your computer and use it in GitHub Desktop.
Save ericzakariasson/88ad4952e66fb79549d2a22d53e24c6b to your computer and use it in GitHub Desktop.
goal: address PR comments
- get PR comments
```bash
# Find PR for current branch
gh pr list --head $(git branch --show-current) | cat
# Get inline comments (most important)
gh api repos/:owner/:repo/pulls/PR_NUMBER/comments --jq '.[] | {author: .user.login, body: .body, path: .path, line: .line}' | cat
# Get review comments if needed
gh api repos/:owner/:repo/pulls/PR_NUMBER/reviews --jq '.[] | select(.body != "") | {author: .user.login, body: .body}' | cat
```
- if no PR exists, abort
- suggest fixes for each comment
- always use `| cat`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment