fix(pullrequests): default mergeMethod to 'merge' when not provided by Will-hxw · Pull Request #2370 · github/github-mcp-server · GitHub
Skip to content

fix(pullrequests): default mergeMethod to 'merge' when not provided#2370

Open
Will-hxw wants to merge 1 commit intogithub:mainfrom
Will-hxw:fix/2258-merge-method-final
Open

fix(pullrequests): default mergeMethod to 'merge' when not provided#2370
Will-hxw wants to merge 1 commit intogithub:mainfrom
Will-hxw:fix/2258-merge-method-final

Conversation

@Will-hxw
Copy link
Copy Markdown

@Will-hxw Will-hxw commented Apr 23, 2026

Summary

Problem

When calling merge_pull_request without providing merge_method, the code was passing an empty string to the GitHub API, which could cause 405 errors on repositories that have disabled merge commits.

Solution

Added a default value check: if mergeMethod is empty string, set it to "merge".

Validation

  • go build ./... passes
  • go test ./pkg/github/... -run "Merge|PullRequest" passes

🤖 Generated with Claude Code

Fixes #2258

…ided

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 github#2258
@Will-hxw Will-hxw requested a review from a team as a code owner April 23, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: merge_pull_request ignores mergeMethod parameter, always attempts merge commit

2 participants