Skip to content

merge_branch

Merge a head branch into a base branch (direct merge, no review required). If the merge would cause conflicts, returns a human-readable diff showing the conflicting changes so you can resolve them manually. Requires Owner role — only Owners can directly merge branches into main, protecting the base model from unreviewed assumption changes.

NameTypeRequiredDefaultDescription
project_nameAnnotated[str, Field(description='Name of the Bridge Town project.')]Yes
head_branchAnnotated[str, Field(description='Name of the branch to merge into base_branch.')]Yes
base_branchAnnotated[str, Field(description="Target branch to merge into. Defaults to 'main'.")]No'main'
commit_messageAnnotated[str, Field(description='Custom commit message for the merge. If omitted, a default is generated.')]No''
expected_head_shaAnnotated[str, Field(description='Optional expected SHA of head_branch tip for optimistic concurrency. Fails if the branch has moved since you last read it.')]No''
dry_runAnnotated[bool, Field(description='When true, validate the merge without committing. Returns conflict status without modifying any branch.')]NoFalse

Returns a structured object. Top-level fields:

  • project (string)
  • head_branch (string)
  • base_branch (string)
  • merged (boolean)
  • conflict (boolean)
  • up_to_date (boolean)
  • message (string)

See the response example below for the full payload shape.

{
"name": "merge_branch",
"arguments": {
"project_name": "forecasts",
"head_branch": "scenario/aggressive-growth",
"base_branch": "main",
"commit_message": "Merge aggressive-growth scenario"
}
}
{
"project": "forecasts",
"head_branch": "scenario/aggressive-growth",
"base_branch": "main",
"merged": true,
"conflict": false,
"up_to_date": false,
"message": "Successfully merged 'scenario/aggressive-growth' into 'main'."
}
  • Module: Branches
  • Requires authentication via API token or Auth0 JWT.