Skip to content

Commit not found if more than 100 commits on a branch #144

@TonyWhiteSMS

Description

@TonyWhiteSMS

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)
            const commits = yield octokit.request("GET /repos/{owner}/{repo}/commits", {
                owner,
                repo,
                sha: branchName,
                per_page: 100,
            });
            return commits.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PRs WelcomeThis has been discussed and a high quality PR would be gratefully acceptedfeatureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions