git-ship
Commit PR CI Merge
Full commit-to-merge flow with CI bypassed via GitHub Actions API.
Workflow
1. Detect repo → 2. Disable workflows → 3. Branch → 4. Commit → 5. Push → 6. PR → 7. Merge → 8. Re-enable workflows → 9. Cleanup
Steps
1. Detect Repository
Extract owner and repo from git remote:
gh repo view --json owner,name --jq '[.owner.login, .name] | @tsv'
Store as OWNER and REPO for all subsequent gh api calls.
2. List and Disable Workflows
Get all active workflows:
gh api repos/{OWNER}/{REPO}/actions/workflows --jq '.workflows[] | select(.state=="active") | [.id, .name] | @tsv'
Disable each PR-triggered workflow:
gh api repos/{OWNER}/{REPO}/actions/workflows/{ID}/disable -X PUT
Track disabled workflow IDs for re-enabling later. Only disable workflows that trigger on pull_request or push events. If unsure, disable all active workflows.
3. Create Feature Branch
If on main/master, create a branch. Use /commit skill conventions for branch naming:
git checkout -b chore/short-description
4. Commit
Use /commit skill for message generation.
Skill(skill="commit")
5. Push
git push -u origin $(git branch --show-current)
6. Create PR
Use /pr-create skill for PR creation. Add a note in the PR body that CI was skipped.
Skill(skill="pr-create")
7. Merge via API
First attempt: merge using the GitHub API with --admin flag:
gh pr merge {PR_NUMBER} --squash --admin
If merge fails with review requirement error (HTTP 405 or "approving review is required"):
- Save current review protection settings:
gh api repos/{OWNER}/{REPO}/branches/main/protection/required_pull_request_reviews --jq '{dismiss_stale_reviews, require_code_owner_reviews, require_last_push_approval, required_approving_review_count}'
- Temporarily remove review requirement:
gh api repos/{OWNER}/{REPO}/branches/main/protection/required_pull_request_reviews -X DELETE
- Merge:
gh pr merge {PR_NUMBER} --squash --admin
- Restore review protection using saved settings (use
--input -with JSON to preserve boolean types):
gh api repos/{OWNER}/{REPO}/branches/main/protection/required_pull_request_reviews -X PATCH --input - <<'EOF'
{saved settings JSON}
EOF
CRITICAL: Always restore branch protection, even if the merge fails. Use the saved settings from step 1 to restore the exact original configuration.
8. Re-enable Workflows
Re-enable all previously disabled workflows:
gh api repos/{OWNER}/{REPO}/actions/workflows/{ID}/enable -X PUT
9. Local Cleanup
git checkout main && git pull && git branch -d {BRANCH_NAME}
Safety
- Never skip CI for code changes that affect behavior
- Always re-enable workflows, even if merge fails
- Track disabled workflow IDs to ensure none are left disabled
- Appropriate for: renames, typos, config changes, documentation
- Not appropriate for: feature code, security changes, dependency updates
More from molechowski/agent-skills
dev-task-queue
Persistent cross-session task queue for AI agents using Claude Code Tasks schema. Add, claim, complete, and reassign tasks with move-based locking, dependency tracking (blocks/blockedBy), conversation transcript linking, and staleness detection. Use for: (1) saving tasks for future agent sessions, (2) cross-session task persistence, (3) multi-agent task coordination, (4) linking conversation transcripts to tasks. Triggers: task queue, save task, agent task, queue task, persistent task, cross-session task, task for agent.
2res-x
Fetch X/Twitter tweet content by URL and search X posts. Resolves tweet links that WebFetch cannot scrape. Use for: reading saved X/Twitter links, fetching tweet content from URLs, searching X for posts on a topic, batch-processing X links from notes. Triggers: x.com link, twitter.com link, fetch tweet, read tweet, what does this tweet say, X search, twitter search.
1res-deep
Iterative multi-round deep research with structured analysis frameworks. Use for: deep research on a topic, compare X vs Y, landscape analysis, evaluate options for a decision, deep dive into a technology, comprehensive research with cross-referencing. Triggers: deep research, compare, landscape, evaluate, deep dive, comprehensive research, which is better, should we use.
1res-web
Research topics with web search. Use when: researching a topic or concept, finding current information, answering factual questions, comparing options or technologies. Triggers: research [topic], find out about, what are the best practices for, research the latest on.
1dev-rlm
Recursive codebase analysis using the RLM paradigm. Use when: analyzing large codebases (100+ files), investigating cross-cutting patterns, recursive decomposition of complex code questions, scanning for issues across entire repos. Triggers: analyze this codebase, how does X work across the codebase, scan all files for Y, recursive analysis, RLM.
1git-repo
Create GitHub repositories via OpenTofu in the github-infrastructure repo. Clones repo to tmp, generates repository module (main.tf, outputs.tf, versions.tf), updates root main.tf and outputs.tf, runs fmt+validate, pushes and creates PR. Use when: (1) creating a new GitHub repo, (2) adding a repository to the org, (3) provisioning a new project/spec/infra/template repo. Triggers: new repo, create repository, add repo, github repository, provision repo.
1