| name | merge-pr |
| description | Merge a PR after confirming CI is green. Fast, correct, no ceremony. |
| argument-hint | [PR number] [--admin] |
| user-invocable | true |
| allowed-tools | Bash |
| truth_contract | {"canonical_sources":["ops/state/truth/policy.json"],"live_load_required":["gh pr view <N> --json mergeable,mergeStateStatus,statusCheckRollup","gh api repos/InterCooperative-Network/icn/branches/main/protection --jq '.required_status_checks.contexts'"],"examples_only":[],"never_hardcode":["required check list (always query live or read policy.json)","PR number or branch name"]} |
Merge a PR. Fast, correct, no ceremony.
Steps
- Confirm current PR + branch:
gh pr view --json number,title,headRefName,baseRefName,state
- If
$ARGUMENTS specifies a PR number, use that
- Check CI status:
gh pr checks
- If checks are still running, report and ask whether to wait
- If all checks are green, merge:
- If branch protection blocks merge:
- If
$ARGUMENTS includes --admin: proceed with gh pr merge --merge --admin
- Otherwise: ask the user once. If they say yes, use
--admin for this merge.
- After merge:
git checkout main && git pull
Output
Report: merged PR #, commit SHA, any follow-ups needed.