From dfb50a0422f543a0bfbc220041d0d300009e4b60 Mon Sep 17 00:00:00 2001 From: Will-hxw <1176843521@qq.com> Date: Thu, 23 Apr 2026 11:17:47 +0800 Subject: [PATCH] fix(pull_requests): set default merge_method to 'merge' when not provided When merge_method is not provided, default to 'merge' instead of passing an empty string to the GitHub API, which could cause the 405 'Merge commits are not allowed' error on repos with squash/rebase only settings. Closes #2258 --- pkg/github/pullrequests.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/github/pullrequests.go b/pkg/github/pullrequests.go index 9c2a098755..f2d0088699 100644 --- a/pkg/github/pullrequests.go +++ b/pkg/github/pullrequests.go @@ -1307,6 +1307,9 @@ func MergePullRequest(t translations.TranslationHelperFunc) inventory.ServerTool if err != nil { return utils.NewToolResultError(err.Error()), nil, nil } + if mergeMethod == "" { + mergeMethod = "merge" + } options := &github.PullRequestOptions{ CommitTitle: commitTitle,