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.

NameTypeRequiredDefaultDescription
model_nameAnnotated[str, Field(description='Name of the Bridge Town model.')]Yes
pull_request_idAnnotated[int, Field(description='Numeric ID of the pull request within the model.')]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''
workspace_id`Annotated[strNone, Field(description=WORKSPACE_ID_FIELD_DESCRIPTION)]`NoNone

Returns a structured object. Top-level fields:

  • model (string)
  • pull_request_id (integer)
  • merged (boolean)
  • message (string)

See the response example below for the full payload shape.

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