Skip to content

Commit e5d6a28

Browse files
committed
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
1 parent 3a6a6f6 commit e5d6a28

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pkg/github/pullrequests.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,9 @@ func MergePullRequest(t translations.TranslationHelperFunc) inventory.ServerTool
13071307
if err != nil {
13081308
return utils.NewToolResultError(err.Error()), nil, nil
13091309
}
1310+
if mergeMethod == "" {
1311+
mergeMethod = "merge"
1312+
}
13101313

13111314
options := &github.PullRequestOptions{
13121315
CommitTitle: commitTitle,

0 commit comments

Comments
 (0)