Open dianabarsan opened 3 years ago
According to the GitHub API docs, the projects endpoint max page size is 100. The shortest fix (which is also what I used locally to generate 3.10.3 release notes) was to add a param per_page: 100
here:
https://github.com/medic/cht-core/blob/master/scripts/changelog-generator/index.js#L41
Let's do the cheap and nasty fix for now. I hope we never go over 100 open projects...
Describe the bug Our changelog-generator script fails with an error when there are too many open organization projects.
To Reproduce
master
. Go toscript
andnpm ci
changelog-generator
. Open the file and check theusage
comment (and create yourtoken.json
file that contains a valid token).3.10.3
as the project.Expected behavior The script should run successfully regardless of the number of open projects.
Additional context The script fails because, apparently, the default page size of the projects API is 30, while the project in question is 31st - bad luck - and we don't implement paginated project navigation - which the GitHub API provides.
The error is caused by the fallback to check repository projects, which is checking
medic
- an archived repo - instead ofcht-core
. The script wouldn't work even if the repo was correct, though.