merge-pull-request
Automatically merge pull requests on GitHub Enterprise by specifying the repository, owner, PR number, and desired merge method (merge, squash, or rebase). Simplifies integration via API for streamlined workflow management.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commit_message | No | Extra detail to append to automatic commit message | |
| commit_title | No | Title for the automatic commit message | |
| merge_method | No | Merge method to use | merge |
| owner | Yes | Repository owner (user or organization) | |
| pull_number | Yes | Pull request number | |
| repo | Yes | Repository name |
Implementation Reference
- api/pulls/pulls.ts:97-107 (handler)The handler function that executes the merge-pull-request tool logic by calling the GitHub PUT /pulls/{pull_number}/merge endpoint.export async function mergePullRequest( client: GitHubClient, params: MergePullRequestParams ): Promise<MergePullRequestResponse> { const { owner, repo, pull_number, ...data } = params; return client.put<MergePullRequestResponse>( `/repos/${owner}/${repo}/pulls/${pull_number}/merge`, data ); }
- api/pulls/types.ts:95-102 (schema)Input schema defining parameters for merging a pull request.export interface MergePullRequestParams { owner: string; repo: string; pull_number: number; commit_title?: string; commit_message?: string; merge_method?: 'merge' | 'squash' | 'rebase'; }
- api/pulls/types.ts:105-109 (schema)Output schema for the merge pull request response.export interface MergePullRequestResponse { sha: string; merged: boolean; message: string; }