Skip to content

Commit 4c7fc71

Browse files
authored
docs: gh pr comments rule (#224)
1 parent 2ae0484 commit 4c7fc71

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

.cursor/rules/gh-pr-comments.mdc

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# .cursor/rules/gh-pr-comments.mdc
2+
---
3+
alwaysApply: false
4+
---
5+
# GitHub CLI - Pull Request Comments & Review Context
6+
7+
This project uses GitHub CLI to fetch and analyze pull request review comments with detailed context.
8+
9+
## Getting Review Comments with Line Numbers & Resolution Status
10+
11+
### Primary Command (GraphQL - Full Featured)
12+
13+
Use GraphQL API to get complete comment context including resolution status and line numbers:
14+
15+
```bash
16+
gh api graphql -f query='
17+
query($owner: String!, $repo: String!, $prNumber: Int!, $cursor: String) {
18+
repository(owner: $owner, name: $repo) {
19+
pullRequest(number: $prNumber) {
20+
reviewThreads(first: 100, after: $cursor) {
21+
pageInfo {
22+
hasNextPage
23+
endCursor
24+
}
25+
nodes {
26+
isResolved
27+
isOutdated
28+
comments(first: 20) {
29+
nodes {
30+
author {
31+
login
32+
}
33+
body
34+
path
35+
line
36+
startLine
37+
originalLine
38+
originalStartLine
39+
diffHunk
40+
createdAt
41+
updatedAt
42+
}
43+
}
44+
}
45+
}
46+
}
47+
}
48+
}
49+
' -f owner=OWNER -f repo=REPO -F prNumber=PR_NUMBER

0 commit comments

Comments
 (0)