Skip to content

Instantly share code, notes, and snippets.

@brasic
Created September 19, 2022 21:20
Show Gist options
  • Save brasic/7bb2ffd6003a5924374531de619bc9e8 to your computer and use it in GitHub Desktop.
Save brasic/7bb2ffd6003a5924374531de619bc9e8 to your computer and use it in GitHub Desktop.
list_all_pr_branches
gh api graphql --paginate -f query='
query($endCursor: String) {
repository(owner: "OWNER", name:"REPO") {
pullRequests(first: 3, after: $endCursor, states: [OPEN], baseRefName: "master") {
nodes {
headRefName
}
pageInfo { endCursor hasNextPage }
}
}
}
' -q '.data.repository.pullRequests.nodes.[].headRefName'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment