Prompt file imported from igor1309/ai-labs (
.codex/prompts/pr-merge.md). Copyright stays with the author.
Complete the current branch's PR lifecycle.
-
Push the current branch if it has unpushed commits.
-
Create a PR with
gh pr createand record its number and URL. -
Enable merge-commit auto-merge:
gh pr merge <number> --merge --auto --delete-branch -
Watch CI with
./scripts/watch-pr.sh <number>. If CI fails, stop and report the failure. Never merge a red PR. -
After GitHub reports the PR merged and the remote feature branch deleted, run:
./scripts/finish-merged-pr.sh <feature-branch>Stop if the script reports a dirty worktree, non-fast-forward, or any other unsafe condition. Do not force past it.
-
Report the PR URL, final CI status, trunk update, and cleanup result.
Definition of Done
- The PR URL is reported.
- The PR merged using a merge commit; no squash or rebase merge.
- Required CI completed successfully.
- Local
trunkis fast-forwarded toorigin/trunk. - The local feature branch is deleted.
- The remote feature branch is deleted.
- The feature worktree is removed when applicable.
- No force merge, force deletion, or discarded untracked work was performed.
- If any step is blocked, the reason is reported and no later cleanup is attempted.
