← ClaudeAtlas

ado-pr-merge-via-apilisted

Completes Pull Request merges in Azure DevOps through the REST API when the UI fails or you need to script them in bulk. Covers 403s from unresolved threads, votes stuck in 'waiting for author' and stale CI gates.
CarlosCaPe/octorato · ★ 16 · API & Backend · score 73
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