github.pulls.merge_pr ​
Merge a GitHub pull request after the caller proves policy and approval requirements.
Merge a GitHub pull request after the caller proves policy and approval requirements.
Merges into the default branch are governed by the caller's approval receipt and skill policy, not by the default-branch guard. delete_head_branch never deletes a head branch that is, or cannot be ruled out as, the repository default branch.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-github |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
organization_uuid | uuid | Yes | — | Organization UUID |
actor | string | No | — | Actor initiating the workflow |
workflow_run_id | string | No | — | Parent workflow run id |
dry_run | boolean | No | — | Validate and plan without mutating GitHub |
github_connection_uuid | uuid | No | — | GitHub installation connection UUID |
repository | string | Yes | — | Repository owner/name |
pull_number | integer | Yes | — | Pull request number |
expected_head_sha | string | Yes | — | Expected PR head SHA |
merge_method | string | No | — | merge, squash, or rebase |
delete_head_branch | boolean | No | — | Delete the pull request head branch after a successful merge in this call |
commit_title | string | No | — | Merge commit title or squash title |
commit_message | string | No | — | Merge commit message or squash body |
approval_receipt | json | Yes | — | Approval/safety evidence from caller workflow |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
status | string | No | — | planned, merged, already_merged, or failed |
repository | string | No | — | — |
pull_number | integer | No | — | — |
merge_method | string | No | — | — |
merged | boolean | No | — | — |
merge_commit_sha | string | No | — | — |
head_branch_deleted | boolean | No | — | — |
head_branch | string | No | — | — |
html_url | string | No | — | — |
applied | boolean | No | — | — |
dry_run | boolean | No | — | — |
warnings | list | No | — | — |
failure_reason | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
failed_at_state | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
failed_at | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "github.pulls.merge_pr",
"initial_data": {
"organization_uuid": "value",
"repository": "value",
"pull_number": 123,
"expected_head_sha": "value"
}
}