Skip to content

Github pagination does not operate if the response is not a list, such as in the list-workflow-runs API #76

@joshzana

Description

@joshzana

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions