gh api --paginate
The api
command now offers functionality to recursively fetch next pages of results until all results have been fetched:
# list all repositories owned by the authenticating user
$ gh api --paginate -XGET user/repos -f affiliation=owner | jq -r '.[].full_name'
# the same but in GraphQL
$ gh api --paginate graphql -f query='
query($endCursor: String) {
viewer {
repositories(first: 100, after: $endCursor, affiliations: [OWNER]) {
nodes {
nameWithOwner
}
pageInfo {
hasNextPage
endCursor
}
}
}
}
' | jq -r '.data.viewer.repositories.nodes[].nameWithOwner'
(#1222)
Fixes
-
Fix
pr create
not respecting template when editor was skipped #1243 -
Fix
pr checkout OWNER:BRANCH
invocation setting up upstream configuration in case maintainers are allowed to modify the pull request branch #1252 -
Fix
pr status
not working in detached HEAD state #1155 -
Do not output ANSI colour escape sequences from
issue/pr/repo view
if standard output is redirected elsewhere #1187 -
Improve error reporting and exit status for mistyped command names #1221
-
Improve error reporting when someone might have forgotten to quote values with spaces #1147