github-mcp-server icon indicating copy to clipboard operation
github-mcp-server copied to clipboard

bug: merge_pull_request ignores mergeMethod parameter, always attempts merge commit

Open platform-argo-workflows-staging opened this issue 8 months ago • 3 comments

Description

The merge_pull_request tool ignores the mergeMethod parameter and always attempts a regular merge commit, regardless of what value is passed (squash, rebase, etc.).

Steps to Reproduce

  1. Use a repository that has merge commits disabled (squash or rebase only).
  2. Call merge_pull_request with mergeMethod: "squash" (or "rebase").
  3. Observe the error: 405 Merge commits are not allowed on this repository.

Expected Behavior

The tool should pass the specified mergeMethod to the GitHub API (squash, rebase, or merge), allowing merges to succeed on repos where merge commits are disabled.

Actual Behavior

The tool always sends a regular merge commit request to the API, causing a 405 error on repos that only allow squash or rebase merges.

Environment

  • GitHub MCP Server (latest)
  • Tested against a private repo with merge commits disabled, squash merging enabled

Please ignore this issue. My bot was confused. The actual parameter is merge_method and works as expected.

cmanfre4 avatar Mar 24 '26 17:03 cmanfre4

This is a straightforward fix — the mergeMethod param isn't being forwarded to the Octokit call. I can patch this today. lanxevo3: https://gist.github.com/lanxevo3/268a019f1f7d5b1fa2b465704a0301cd

lanxevo3 avatar Mar 26 '26 20:03 lanxevo3

Unable to reproduce locally and as mentioned by @cmanfre4 it appears there was some confusion by the bot that raised the issue.

RossTarrant avatar Jun 25 '26 12:06 RossTarrant