File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -298,6 +298,17 @@ async function getPullRequestEditedDiffRanges(
298
298
if ( fileDiffs === undefined ) {
299
299
return undefined ;
300
300
}
301
+ if ( fileDiffs . length >= 300 ) {
302
+ // The "compare two commits" API returns a maximum of 300 changed files. If
303
+ // we see that many changed files, it is possible that there could be more,
304
+ // with the rest being truncated. In this case, we should not attempt to
305
+ // compute the diff ranges, as the result would be incomplete.
306
+ logger . warning (
307
+ `Cannot retrieve the full diff because there are too many ` +
308
+ `(${ fileDiffs . length } ) changed files in the pull request.` ,
309
+ ) ;
310
+ return undefined ;
311
+ }
301
312
const results : DiffThunkRange [ ] = [ ] ;
302
313
for ( const filediff of fileDiffs ) {
303
314
const diffRanges = getDiffRanges ( filediff , logger ) ;
You can’t perform that action at this time.
0 commit comments