New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--paginate
doesn't work well with /enterprises/{enterprise}/consumed-licenses
and ?page=
#8419
Comments
Funny, if you add |
@jessehouwing : I think you're experiencing a common behavior of In the mean time, you would need to leverage # should produce a single JSON array of all paginated result concatenated:
gh api graphql -f query='QUERY' --paginate --jq '.data.repository.branchProtectionRules.nodes[]' | jq -s That said, passing page and per_page to the GH_DEBUG=api gh api /enterprises/{enterprise}/consumed-licenses --paginate -F page=2 -X GET -F per_page=10 |
That's quite unexpected. But reading through it, I understand the complexity. Relying on the presence of jq is indeed not obvious, since it's not a common utility on windows. The fact that there is a |
That is a fair assessment. Is there anything you would suggest we do outside of the larger work in #1268 for the short term to avoid the confusion? For example, what might you expect to see in the |
If it could add a separator somehow it would become much easier to split the resulting text into parts so that other scripting languages can more easily work with the result sets. But for now I'd expect this behavior to be documented here:
And it mentions nothing of the sort. Many parts of Ideally |
Copilot suggests doing something akin to:
which could probably be
|
I think the way to look at it is that |
True. Agreed. Yet there are few tools that will be able to parse the output by default. To them it's not something they understand. |
Describe the bug
Version:
When running
gh api "https://api.github.com/enterprises/{enterprise}/consumed-licenses" --paginate
, it returns a broken json object:So the user must loop through the pages themselves and concatenate the content like so:
Steps to reproduce the behavior
gh api "https://api.github.com/enterprises/{enterprise}/consumed-licenses" --paginate
Expected vs actual behavior
The content is correctly concatenated and a single json object is returned
Related: #6044
The text was updated successfully, but these errors were encountered: