As it's possible to select which kinds of methods for "merging" a PR is allowed, i.e. any/all of these:
merge
rebase
squash
Thus one can run into problems such as this one (if a repo has disallowed "merge commits"):
failed to merge Pull Request https://github.com/my-org/my-repo/pull/310: PUT https://api.github.com/repos/my-org/my-repo/pulls/310/merge: 405 Merge commits are not allowed on this repository. []" repository=my-org/my-repo
Full log row:
time="2023-11-20T10:39:22Z" level=error msg="Repository update failed" error="failed to merge Pull Request https://github.com/my-org/my-repo/pull/310: failed to merge Pull Request https://github.com/my-org/my-repo/pull/310: PUT https://api.github.com/repos/my-org/my-repo/pulls/310/merge: 405 Merge commits are not allowed on this repository. []" repository=my-org/my-repo
Showing on the PR like this in the web UI:
But it's only possible to select one to try with, as per:
--pr-merge-method (string): the merge method to use. Either merge, squash, or rebase. Default to merge.
As it's possible to select which kinds of methods for "merging" a PR is allowed, i.e. any/all of these:
Thus one can run into problems such as this one (if a repo has disallowed "merge commits"):
failed to merge Pull Request https://github.com/my-org/my-repo/pull/310: PUT https://api.github.com/repos/my-org/my-repo/pulls/310/merge: 405 Merge commits are not allowed on this repository. []" repository=my-org/my-repo
Full log row:
time="2023-11-20T10:39:22Z" level=error msg="Repository update failed" error="failed to merge Pull Request https://github.com/my-org/my-repo/pull/310: failed to merge Pull Request https://github.com/my-org/my-repo/pull/310: PUT https://api.github.com/repos/my-org/my-repo/pulls/310/merge: 405 Merge commits are not allowed on this repository. []" repository=my-org/my-repo
Showing on the PR like this in the web UI:
But it's only possible to select one to try with, as per:
...and in an organization with hundreds/thousands or repositories it might not be feasible to know/decide with merge method is allowed on the repos 🙈.
Hence I'd like to suggest we add either:
--pr-merge-method
(which tries all of them, in some kind of order)--pr-merge-methods
with a list (of the ones to try, and in which order)--pr-merge-methods
(ditto)