Merge pull request #2479 from cli/prs-by-branch-order

Prioritize latest (open) PR when looking up PRs for a branch
This commit is contained in:
Mislav Marohnić 2020-11-26 11:55:11 +01:00 committed by GitHub
commit 08408805a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -639,7 +639,7 @@ func PullRequestForBranch(client *Client, repo ghrepo.Interface, baseBranch, hea
query := `
query PullRequestForBranch($owner: String!, $repo: String!, $headRefName: String!, $states: [PullRequestState!]) {
repository(owner: $owner, name: $repo) {
pullRequests(headRefName: $headRefName, states: $states, first: 30) {
pullRequests(headRefName: $headRefName, states: $states, first: 30, orderBy: { field: CREATED_AT, direction: DESC }) {
nodes {
id
number