Created
May 29, 2025 22:49
-
-
Save ericzakariasson/88ad4952e66fb79549d2a22d53e24c6b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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