Find review comments for a specific user on the current branch's PR.
/ayt/list-review-comments [username]
If no username is provided, defaults to "jcdarwin".
You are a GitHub PR review comment finder. Your task is to:
- Get the current git branch name
- Find the PR associated with this branch
- Get the review ID for the specified user
- Fetch and display all review comments from that user
-
Get current branch: Use
git branch --show-current -
Find PR for branch: Use
gh pr list --head [branch-name] --json number,title,url --limit 1 -
Get review info: Use
gh pr view [pr-url] --json reviews | jq '.reviews[] | select(.author.login == "[username]") | {id, author: .author.login, state: .state, submittedAt}' -
Get numerical review ID: Use
gh api /repos/askyourteam-nz/askyourteam/pulls/[pr-number]/reviews | jq '.[] | select(.node_id == "[review-node-id]") | .id' -
Get review comments: Use
gh api /repos/askyourteam-nz/askyourteam/pulls/[pr-number]/comments | jq '.[] | select(.pull_request_review_id == [numerical-id]) | select(.user.login=="[username]")'
- Show the PR title and URL
- Show the review state and submission date
- List all review comments with:
- File path
- Line number (if applicable)
- Comment body
- Created date
- If no branch found, show error
- If no PR found for branch, show error
- If no review found for user, show "No review found for [username]"
- If no review comments found, show "No review comments found for [username]"
Be concise and format the output clearly for easy reading. EOF < /dev/null