| name | github-pr-workflow |
| description | Working with GitHub Pull Requests using the gh CLI. Use for fetching PR details, review comments, CI status, and understanding the difference between PR-level comments vs inline code review comments. |
GitHub PR Workflow
Key Concepts
Comment Types
GitHub PRs have two different types of comments:
- PR-level comments - General discussion on the PR (shown via
gh pr view --comments)
- Inline code review comments - Comments attached to specific lines of code (requires API)
Important: gh pr view --comments does NOT show inline code review comments!
Scripts
| Script | Purpose |
|---|
gh-pr-info <PR> [REPO] | Comprehensive PR info: summary, CI checks and unresolved review and inline comments |
The script auto-detects the repo from git remote, or accepts [REPO] as second argument (format: owner/repo).
Key features:
- Uses GitHub's GraphQL API to reliably filter out already resolved/addressed comments
- Excludes collapsed/hidden review threads
- Excludes minimized comments (marked as spam/off-topic/resolved)
- Excludes dismissed reviews
- Shows only what still needs attention
Common Commands
gh-pr-info <PR> [REPO]
gh view <PR>
gh view <PR> --comments
gh diff <PR>
gh review <PR> --approve
gh review <PR> --request-changes --body
gh review <PR> --comment --body
gh checks <PR>
gh run view <RUN_ID> --log-failed