← ClaudeAtlas

landing-an-approved-github-pr-blocked-by-threadslisted

Land an approved GitHub PR that is still BLOCKED, end to end: reply to and resolve every open review thread, update or fix a stale or conflicting branch, then merge (auto-merge if blocked) and wait until MERGED. Refuses with 0 approvals or a standing changes-request. Triggers on: merge this PR, resolve the threads and merge, base branch policy prohibits the merge, BLOCKED with approvals, conversation resolution required, BLOCKED again after update, get this PR merged, land the PR.
sblattj/agent-chandlery · ★ 0 · Code & Development · score 72
Install: claude install-skill sblattj/agent-chandlery
## More triggers resolve-pr-threads-and-conflicts-and-merge (old name), approved but can't merge, why won't it merge with approvals. # Land an approved PR blocked by threads One script takes an approved PR from BLOCKED to MERGED, and never merges one with 0 approvals or a standing changes-request. Needs `zsh`, `gh` and `jq`. ## Do this ```bash L=${CLAUDE_SKILL_DIR:-${SKILL_DIR:-~/.claude/skills/landing-an-approved-github-pr-blocked-by-threads}}/land.sh $L <pr> --dry-run # repo = the cwd's (gh repo view); lists threads with no reply (exit 2) $L <pr> -R owner/repo --dry-run # any other repo $L <pr> -R owner/repo --replies replies.json # post replies, resolve, update branch, merge, wait (default 600s) ``` `replies.json` is `[{"cid":"<thread's first comment databaseId>","body":"markdown"}]`. The dry run prints each thread URL; the id is the number after `discussion_r`. Log: `/tmp/land-pr/<repo>-<pr>.log` (override with `LOG=`). Exit codes: - 0: merged - 2: threads still need a reply - 3: conflicts - 4: not merged within `--wait` - 5: draft, closed or bad arguments - 6: no approval yet, or someone's changes-request still stands What the script does: 1. **Conflicting (exit 3):** stops. Merge the base into the branch in a worktree (never rebase a shared branch), resolve, run the module's tests, push, rerun. 2. **BEHIND:** runs `gh pr update-branch`. 3. **Threads:** posts each reply and resolves the thread. It