github / pages-gem

A simple Ruby Gem to bootstrap dependencies for setting up and maintaining a local Jekyll environment in sync with GitHub Pages
http://pages.github.com
MIT License
1.82k stars 349 forks source link

Gem may fail if a user has a repository with many contributors #915

Open bkmgit opened 4 months ago

bkmgit commented 4 months ago

Before submitting an issue, please be sure to

This issue affects

The GitHub Pages Gem is intended to help users replicate the GitHub Pages build environment locally. If your issue affects both the hosted version and the version previewed locally, you may be better suited reporting seeking support in other forums.

What did you do (e.g., steps to reproduce)

Ran the Gem when generating a website at https://github.com/bkmgit/2024-05-06-uci-nnlm-online/tree/gh-pages with a fork of https://github.com/sched-ext/sched_ext in my userspace.

What did you expect to happen?

Expected the site to build.

What happened instead?

Site failed to build with log message:

Liquid Exception: GET https://api.github.com/repos/bkmgit/sched_ext/contributors?per_page=100: 403 - The history or contributor list is too large to list contributors for this repository via the API. // See: https://docs.github.com/rest/repos/repos#list-repository-contributors in /_layouts/base.html
/usr/local/bundle/gems/octokit-4.25.1/lib/octokit/response/raise_error.rb:14:in `on_complete': GET https://api.github.com/repos/bkmgit/sched_ext/contributors?per_page=100: 403 - The history or contributor list is too large to list contributors for this repository via the API. // See: https://docs.github.com/rest/repos/repos#list-repository-contributors (Octokit::Forbidden)

Error can be reproduced by calling

$ curl -L \
> -H "Accept: application/vnd.github+json" \
> -H "X-GitHub-Api-Version: 2022-11-28" \
> https://api.github.com/repos/sched_ext/sched_ext/contributors

Additional information

Initially reported at https://github.com/carpentries/workshop-template/issues/820

parkr commented 4 months ago

Filed in the gem that caused this error: https://github.com/jekyll/github-metadata/issues/283

bkmgit commented 4 months ago

Thanks.