Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub: use files API with pagination #1440

Merged
merged 1 commit into from
May 5, 2024

Conversation

fabianehlert
Copy link
Contributor

Switched from using the GitHub API Get a pull request to the List pull requests files API, incorporating pagination to retrieve pull request diffs. This change enables the analysis of pull requests containing more than 300 files.

Although the 300 file limit on the "Get a pull request" API isn't new, GitHub recently began enforcing it with a HTTP 406 status code. Currently, Danger is failing when analyzing pull requests exceeding this limit.

The "List pull requests files" API returns a slightly different git diff format, omitting the initial diff --git … part which parse-diff expects. As a hack, I'm adding it manually now.

Happy to hear your feedback on this approach :)

Fixes #1432 and danger/swift#606

@orta
Copy link
Member

orta commented May 5, 2024

This seems reasonable to me 👍🏻

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.

[BUG] GitHub API request fails for PR with > 300 files change
2 participants