Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add auto-merge support to pull request tools

未关闭
#2,411 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
github, go, graphql
领域
api, backend, tooling

调研方向

Start at the existing merge_pull_request tool and compare its pull request inputs with the GitHub GraphQL enablePullRequestAutoMerge mutation. Implement the proposed auto-merge operation with owner, repo, pullNumber, and mergeMethod handling; determine from the surrounding pull request tools whether disablePullRequestAutoMerge belongs in scope. Done means MCP clients can enable auto-merge without falling back to the gh CLI.

由索引模型根据 Issue 内容生成。

描述

[!Note]
Responses generated with Claude

Describe the feature or problem you'd like to solve

There is no MCP equivalent for enabling auto-merge on a pull request (gh pr merge --auto --squash). This is a common workflow step after CI passes and approvals are in place.

Currently the only way to enable auto-merge via MCP clients is to fall back to gh CLI, which breaks the MCP-first workflow pattern and causes permission prompt friction in tools like Claude Code.

Proposed solution

Add an enable_auto_merge method (or similar) to the pull request write tools. The GitHub GraphQL API exposes the enablePullRequestAutoMerge mutation:

mutation($pullRequestId: ID!, $mergeMethod: PullRequestMergeMethod!) {
  enablePullRequestAutoMerge(input: {
    pullRequestId: $pullRequestId
    mergeMethod: $mergeMethod
  }) {
    pullRequest { autoMergeRequest { enabledAt mergeMethod } }
  }
}

Parameters:

  • owner (required): Repository owner
  • repo (required): Repository name
  • pullNumber (required): PR number
  • mergeMethod (optional): MERGE, SQUASH, or REBASE (default to repo setting)

A corresponding disablePullRequestAutoMerge mutation exists and could be included.

Example prompts or workflows
  1. "Enable auto-merge on PR #123 with squash"
  2. "Once CI passes, auto-merge this PR"
  3. "Set up auto-merge for all my approved PRs"
Additional context

The existing merge_pull_request tool handles immediate merges, but auto-merge is a distinct operation — it queues the merge to happen automatically once all required status checks and approvals are satisfied. This is particularly useful in CI-heavy repos where PRs can't be merged until checks complete.

主要语言
Go
星标
33.1k
派生
5k
平均合并
2 天 1 小时
30 天内合并 PR
25

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/github-mcp-server 的其他 Issue

查看 github/github-mcp-server 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。