-
Notifications
You must be signed in to change notification settings - Fork 4
feat: support pull requests with more than 300 changed files #32
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
feat: support pull requests with more than 300 changed files #32
Conversation
Use paginated pulls.listFiles API instead of pulls.get with diff format, which has a 300 file limit. Add parsePatch function to handle individual file patches from the listFiles response.
src/utils/diff.ts
Outdated
| export function parsePatch(patch: string | undefined): number[] { | ||
| if (!patch) { | ||
| return [] | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me this is a possible case. I think this may be better without undefined.
| @@ -1,5 +1,5 @@ | |||
| import * as core from '@actions/core' | |||
| import * as diff from './diff' | |||
| import {parsePatch} from './diff' | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should check, because there may be a function we could remove or this should go back to *.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parseGitDiff is no longer called except in tests. Should we keep it or remove it?
Move undefined check to the caller in getPullRequestDiff where file.patch may be undefined from the GitHub API response.
|
@ggilder This is ready for review. Thanks for your work on this action, I've used it in several projects over the past few weeks and it's worked nicely! |
ggilder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you for the contribution!
|
Just released 👍 |

I ran into this over at deviantintegral/pantheon-metrics-prometheus#46. That project vendors dependencies (which is common in golang at least), and making updates to them triggered an error for annotations.
https://github.com/deviantintegral/pantheon-metrics-prometheus/actions/runs/21081006077/job/60634487862
I'm in the process of reviewing and testing this now, I'll mark it as ready when I'm done!