merge_pull_request
Merge a pull request with a chosen strategy: merge, squash, rebase, or rebase-merge. Confirm the PR's mergeability first, and optionally supply a custom title and message for the merge commit.
Instructions
Merge a pull request by index. Do selects the strategy: 'merge' (merge commit), 'squash' (single commit), 'rebase' (rebase + fast-forward), 'rebase-merge' (rebase + merge commit). Optional MergeTitleField/MergeMessageField customize the merge commit; SHA guards against branch drift. IRREVERSIBLE — confirm the index, strategy, and that the PR is mergeable (get_pull_request mergeable: true) with the user BEFORE merging. Check is_pull_merged first if unsure.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Do | Yes | Merge strategy: 'merge' (merge commit), 'squash' (single commit), 'rebase' (rebase then fast-forward), 'rebase-merge' (rebase then merge commit) | |
| SHA | No | The expected HEAD SHA of the PR (fails if the branch moved since) | |
| repo | No | Repository name (defaults to GITEA_DEFAULT_REPO) | |
| index | Yes | Pull request number | |
| owner | No | Repository owner (defaults to GITEA_DEFAULT_OWNER) | |
| MergeTitleField | No | Title for the merge commit | |
| MergeMessageField | No | Message body for the merge commit |