Approve pull request at exact head
gh_approve_prApprove a pull request by submitting a formal GitHub review, but only after verifying the exact head SHA and reviewer login. Ensures the approval comes from an independent reviewer, not the PR author.
Instructions
Additive write: submit exactly one formal GitHub APPROVED review for the supplied exact pull-request head through the server-configured independent reviewer principal. Before the review POST the server verifies repository write policy, current head, expected reviewer login, authenticated reviewer login, and reviewer != PR author. The caller cannot select credentials. The write is attempted once and immutable review-ID readback verifies APPROVED state, actor, head, and body. It never comments as a fallback, merges, dismisses reviews, or retries an ambiguous mutation automatically.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | Optional Markdown body for the APPROVED review. | |
| repo | Yes | GitHub repository name without the owner prefix. | |
| owner | Yes | GitHub repository owner or organization login. | |
| number | Yes | Pull request number to approve. | |
| expected_head_sha | Yes | Exact pull-request head SHA that was independently reviewed. | |
| expected_reviewer_login | Yes | Exact reviewer actor login expected from the server-configured reviewer principal. This is a compare-only precondition and never selects credentials. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| body | Yes | ||
| state | Yes | ||
| action | No | approve | |
| author | No | ||
| number | Yes | ||
| message | Yes | ||
| warning | No | ||
| review_id | Yes | ||
| commit_sha | Yes | ||
| request_id | No | ||
| submitted_at | No | ||
| write_completed | Yes | ||
| readback_completed | Yes | ||
| precondition_checked | Yes | ||
| state_matches_requested | Yes |