You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a large number of commits have been made to a branch (eg more 200) it fails to verify that the commitExists on the branch.
I believe that this code is not finding the commit due the number of commits being limited to 100
// Check the commit exists on the expected main branch (it will not in the case of a rebased main branch)constcommits=yieldoctokit.request("GET /repos/{owner}/{repo}/commits",{
owner,
repo,sha: branchName,per_page: 100,});returncommits.data.some((commit)=>commit.sha===commitSha);
Obviously going back to the start of the repo could be expensive, so perhaps a customisable limit of commits/pages could be allowed. In my instance I am currently looking at a pull req with 940+ commits for an upcoming release.
The text was updated successfully, but these errors were encountered:
I have come up with a solution that should work for us, it is hard coded to a 20 page (2K commit limit)
// Check the commit exists on the expected main branch (it will not in the case of a rebased main branch)letmaxPages=20;letcommitFound=false;yieldoctokit.paginate("GET /repos/{owner}/{repo}/commits",{
owner,
repo,sha: branchName,per_page: 100,},(response,done)=>{if(response.data.some((commit)=>commit.sha===commitSha)){commitFound=true;done();}// End after maxPages reachedif(maxPages<=0){done();}maxPages--;returnresponse;});returncommitFound;
Hi there @TonyWhiteSMS ! Thank you for the feature request and the suggested implementation! Do you want to submit a PR, and I can review it? Thank you for your patience!
When a large number of commits have been made to a branch (eg more 200) it fails to verify that the commitExists on the branch.
I believe that this code is not finding the commit due the number of commits being limited to 100
Obviously going back to the start of the repo could be expensive, so perhaps a customisable limit of commits/pages could be allowed. In my instance I am currently looking at a pull req with 940+ commits for an upcoming release.
The text was updated successfully, but these errors were encountered: