Merge an existing pull request on GitHub
mergePullRequest
method allows you to programmatically merge an existing pull request on GitHub. It supports different merge methods (merge, squash, rebase) and allows customization of the commit message.
Parameter | Type | Required | Description |
---|---|---|---|
pullNumber | number | Yes | The number of the pull request to merge |
commitTitle | string | No | Custom title for the merge commit |
commitMessage | string | No | Custom message for the merge commit |
mergeMethod | 'merge' | 'squash' | 'rebase' | No | The merge method to use (defaults to ‘merge’) |
merge
: Creates a merge commit with all commits from the feature branchsquash
: Squashes all commits into a single commit before mergingrebase
: Rebases the commits onto the base branchProperty | Type | Description |
---|---|---|
sha | string | The SHA of the merge commit |
merged | boolean | Whether the pull request was successfully merged |
message | string | A message describing the merge result |
mergePullRequest
does NOT require agent or sandbox configuration.
createPullRequest
- Create a new pull requestpushToBranch
- Push changes to a branchgenerateCode
- Generate code using AI agents