ado-pr-merge-via-apilisted
Install: claude install-skill CarlosCaPe/octorato
# ADO Pull Request Merge via REST API
Workflow for completing a PR on Azure DevOps via the REST API instead of
the web UI. Covers the three common 403s and how to clear each.
## When to use
- Scripting PR completion as part of a delivery pipeline.
- The UI is slow / sessions are flaky / SSO loop.
- Bulk-merging multiple ready PRs.
- An agent acting on behalf of the operator with an ADO PAT.
## What this skill does NOT do
Does not bypass content review. The operator is expected to have already
done the review (or approved the changes consciously). This is a procedural
workflow for the *merge action* — not for replacing human judgment on the
diff.
## The core sequence (happy path)
```text
1. GET /git/repositories/{repoId}/pullRequests/{prId}
→ confirm mergeStatus="succeeded" and lastMergeSourceCommit.commitId
2. PUT /git/repositories/{repoId}/pullRequests/{prId}/reviewers/{userId}
→ body { vote: 10, id: userId } (10 = approved)
3. PATCH /git/repositories/{repoId}/pullRequests/{prId}/threads/{threadId}
→ body { status: "fixed" | "closed" } for each open thread you own
4. PATCH /git/repositories/{repoId}/pullRequests/{prId}
→ body {
status: "completed",
lastMergeSourceCommit: { commitId: <from step 1> },
completionOptions: {
mergeStrategy: "noFastForward", // or "squash" / "rebase"
deleteSourceBranch: false,
bypassPolicy: false,
}
}
→ on 200: completion succeeded; new commit at lastMe