Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@cthulhuology
Copy link

While using the NPM repo at work to automat pulls and checkouts of our source trees, we ran into an issue where the Github API is limiting the requests to 100 repos per page. As a result the query for 1000 results per page only results in the first 100 repos.

The following code adds a recursive function that walks the pages until an empty result [] or an error occurs. In practice I've tested this with an account with 118 repos. I don't have an account with >200 repos, so I have not yet tested page 3.

Integration tests require adding >100 repos to github and have obvious cleanup problems, so I have not supplied any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant