agithub
agithub copied to clipboard
Github pagination does not operate if the response is not a list, such as in the list-workflow-runs API
The List workflow runs GitHub API returns an object with a nested list. It also returns the standard GitHub link headers to support pagination.
With the following code, no pagination occurs:
github_client = GitHub(token=GITHUB_TOKEN, paginate=True)
status, data = github_client.repos.falkonai.server.actions.workflows[
"<workflow_name>"
].runs.get()
I believe the issue is this check in the Github request
method:
if self.paginate and type(data) == list:
Since data
is a dict here. I don't know why Github chose to make this API return an object instead of a list.