Skip to content

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.

NameTypeRequiredDefaultDescription
project_nameAnnotated[str, Field(description='Name of the Bridge Town project.')]Yes
pull_request_idAnnotated[int, Field(description='Numeric ID of the pull request within the project.')]Yes
styleAnnotated[Literal['merge', 'rebase', 'squash'], Field(description="Merge style: 'merge' (merge commit), 'rebase' (rebase and merge), or 'squash' (squash and merge).")]No'merge'
commit_titleAnnotated[str, Field(description='Optional title for the merge commit.')]No''
expected_head_shaAnnotated[str, Field(description='Optional SHA of the PR head commit for optimistic concurrency control.')]No''

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.

{
"name": "merge_pull_request",
"arguments": {
"project_name": "forecasts",
"pull_request_id": 42,
"commit_title": "Merge: aggressive growth scenario",
"style": "squash"
}
}
{
"project": "forecasts",
"pull_request_id": 42,
"merged": true,
"message": "Pull request merged."
}
  • Module: Pull Requests
  • Requires authentication via API token or Auth0 JWT.