Skip to content

Commit 21e2544

Browse files
committed
Sort latest PRs first when looking up PRs for a branch
Fixes cli#2452
1 parent d6c9004 commit 21e2544

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/queries_pr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ func PullRequestForBranch(client *Client, repo ghrepo.Interface, baseBranch, hea
639639
query := `
640640
query PullRequestForBranch($owner: String!, $repo: String!, $headRefName: String!, $states: [PullRequestState!]) {
641641
repository(owner: $owner, name: $repo) {
642-
pullRequests(headRefName: $headRefName, states: $states, first: 30) {
642+
pullRequests(headRefName: $headRefName, states: $states, first: 30, orderBy: { field: CREATED_AT, direction: DESC }) {
643643
nodes {
644644
id
645645
number

0 commit comments

Comments
 (0)