Skip to content

merge_pull_request

Merge an approved pull request into its base branch. Under the default-off independent-approval setting, an eligible author may explicitly approve their own PR when the user requests approval or adoption. When independent approval is enabled, an eligible actor other than the PR author must approve. Requires Owner role. style options: ‘merge’ (merge commit, default), ‘squash’ (squash into one commit), ‘rebase’ (rebase onto base branch).

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 an authenticated Bridge Town session (OAuth) or an API token.