> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Merge GitHub pull request

> Merge a pull request using an allowed repository merge method.

`mergeGitHubPullRequest` asks GitHub to merge a pull request.

```ts automations/merge-github-pull-request.automation.ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { mergeGitHubPullRequest } from "automate.ax/github"

export default automation("Merge GitHub pull request", () => {
  onHttpRequest({ scope: "automation" })
  mergeGitHubPullRequest({
    owner: "SentsCo",
    repository: "automate.ax",
    pullRequestNumber: 173,
    mergeMethod: "squash",
  })
})
```

`owner`, `repository`, and positive integer `pullRequestNumber` are required. Optional fields are `mergeMethod` (`"merge"`, `"rebase"`, or `"squash"`), `commitTitle`, `commitMessage`, expected head `sha`, and `account`. Inputs accept compatible signals.

Returns `{ merged: boolean; message: string; sha: string | null }`. A false `merged` result explains why GitHub did not merge. Repository rules, required checks, reviews, merge conflicts, disabled methods, or a mismatched `sha` can prevent merging.
