Wait for CI to pass, then merge PR and update local branch
Monitors CI checks on a PR, merges when passing, and updates local branch.
/plugin marketplace add bengous/claude-code-plugins/plugin install git-tools@bengous-plugins[pr-number]sonnetMonitor CI checks on a PR. When all checks pass, merge the PR and update the local branch to include the merged changes.
Use $ARGUMENTS if provided (PR number or URL). Otherwise, detect from current branch with gh pr view. If detection fails, stop and ask the user to provide the PR number.
Run these commands to gather context:
gh pr view <pr> --json number,baseRefName,commits,title
gh pr checks <pr>
Use AskUserQuestion to let the user choose:
Question: "How should this PR be merged?" Header: "Merge" Options:
Include the commit count and titles in the question context so the user can make an informed decision.
Poll gh pr checks until all checks complete. Report status changes as they occur.
If checks fail: Stop and report which checks failed. Do not attempt to merge.
When all checks pass, merge the PR using the strategy chosen in step 2.
Execute: gh pr merge <pr> --delete-branch with --squash or --merge accordingly.
If merge fails: Report the error (conflicts, branch protection, etc). Do not retry.
Checkout the base branch and pull:
git checkout <baseRefName>
git pull
Summarize: PR merged, strategy used, local branch updated.