merge_pull_request
Merge an approved pull request into its base branch. Requires Owner role. style options: ‘merge’ (merge commit, default), ‘squash’ (squash into one commit), ‘rebase’ (rebase onto base branch). Safety: pass expected_head_sha (the PR head commit SHA from get_pull_request) to guard against new commits pushed to the PR branch since you last checked. Returns: project (str); pull_request_id (int); merged (bool); message (str); audit_id (str) — correlation ID present in the audit log for this merge.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
project_name | Annotated[str, Field(description='Name of the Bridge Town project.')] | Yes | — | |
pull_request_id | Annotated[int, Field(description='Numeric ID of the pull request within the project.')] | Yes | — | |
style | Annotated[Literal['merge', 'rebase', 'squash'], Field(description="Merge style: 'merge' (merge commit), 'rebase' (rebase and merge), or 'squash' (squash and merge).")] | No | 'merge' | |
commit_title | Annotated[str, Field(description='Optional title for the merge commit.')] | No | '' | |
expected_head_sha | Annotated[str, Field(description='Optional SHA of the PR head commit for optimistic concurrency control.')] | No | '' |
Returns
Section titled “Returns”Returns a structured object. Top-level fields:
project(string)pull_request_id(integer)merged(boolean)message(string)
See the response example below for the full payload shape.
Example
Section titled “Example”Tool Call
Section titled “Tool Call”{ "name": "merge_pull_request", "arguments": { "project_name": "forecasts", "pull_request_id": 42, "commit_title": "Merge: aggressive growth scenario", "style": "squash" }}Response
Section titled “Response”{ "project": "forecasts", "pull_request_id": 42, "merged": true, "message": "Pull request merged."}- Module:
Pull Requests - Requires authentication via API token or Auth0 JWT.