<< All versions
Skill v1.0.0
currentAutomated scan100/100hezaohezao/poirot/github-pr-workflow
──Details
PublishedOctober 24, 2026 at 11:41 PM
Content Hashsha256:bc1c9a99de286a4f...
Git SHA86bf279ad90c
──Files
Files (1 file, 4.1 KB)
SKILL.md4.1 KBactive
SKILL.md · 192 lines · 4.1 KB
version: "1.0.0" name: github-pr-workflow description: "GitHub PR lifecycle: branch, commit, open, CI, merge." allowed-tools:
- bash
- read_file
enabled: true related-skills: [github-auth, github-code-review] license: MIT author: Adapted from hermes-agent (Nous Research, MIT)
GitHub Pull Request Workflow
Complete guide for managing the PR lifecycle. gh first, git + curl fallback.
Prerequisites
- Authenticated with GitHub (see
github-authskill) - Inside a git repository with a GitHub remote
1. Branch & Commit
bash
# Create feature branchgit checkout -b feature/add-login# Make changes, commitgit add -Agit commit -m "feat: add login endpoint"# Pushgit push -u origin feature/add-login
2. Create PR
bash
# With gh (interactive)gh pr create# With gh (inline)gh pr create \--title "feat: add login endpoint" \--body "## Changes- Add /api/login route- Add JWT token generation- Add tests## Testing\`\`\`bashpytest tests/test_auth.py -v\`\`\`" \--base main \--head feature/add-login# With curlcurl -s -X POST \-H "Authorization: token $GITHUB_TOKEN" \https://api.github.com/repos/$OWNER/$REPO/pulls \-d '{"title":"feat: add login endpoint","body":"Add /api/login route with JWT","head":"feature/add-login","base":"main"}'
3. Check CI Status
bash
# With ghgh pr checks 42# With curl (check runs)curl -s "https://api.github.com/repos/$OWNER/$REPO/commits/$HEAD_SHA/check-runs" | python3 -c "import sys, jsonfor r in json.load(sys.stdin)['check_runs']:print(f'{r[\"name\"]:30s} {r[\"conclusion\"] or r[\"status\"]}')"# With curl (statuses — legacy CI)curl -s "https://api.github.com/repos/$OWNER/$REPO/commits/$HEAD_SHA/status" | python3 -c "import sys, jsonr = json.load(sys.stdin)print(f'Overall: {r[\"state\"]}')for s in r['statuses']:print(f' {s[\"context\"]:30s} {s[\"state\"]}')"
4. Update PR (push more commits)
bash
# Make more changesgit add -Agit commit --fixup HEAD # or regular commitgit push# PR automatically updates
5. Review & Approve
bash
# Request reviewgh pr edit 42 --add-reviewer username# Approve (as reviewer)gh pr review 42 --approve --body "LGTM!"# Request changesgh pr review 42 --request-changes --body "See inline comments."# Commentgh pr review 42 --comment --body "Some suggestions."
6. Merge
bash
# With ghgh pr merge 42 --merge # merge commitgh pr merge 42 --squash # squash mergegh pr merge 42 --rebase # rebase mergegh pr merge 42 --squash --delete-branch # squash + delete branch# With curlcurl -s -X PUT \-H "Authorization: token $GITHUB_TOKEN" \https://api.github.com/repos/$OWNER/$REPO/pulls/42/merge \-d '{"merge_method":"squash"}'
7. Cleanup
bash
# Delete local branchgit checkout maingit pull origin maingit branch -d feature/add-login# Delete remote branch (if not auto-deleted)git push origin --delete feature/add-login
Full Workflow Example
bash
# 1. Branchgit checkout -b fix/issue-42-login-timeout# 2. Implement + test# ... make changes ...pytest tests/test_auth.py -v# 3. Commitgit add -Agit commit -m "fix: increase login timeout to 30s (fixes #42)"# 4. Pushgit push -u origin fix/issue-42-login-timeout# 5. Create PRgh pr create --title "fix: increase login timeout (fixes #42)" --body "..." --base main# 6. Check CIgh pr checks# 7. After CI passes + review approvedgh pr merge --squash --delete-branch# 8. Cleanupgit checkout main && git pull
Pitfalls
- `fixes #42`: auto-closes issue 42 on merge. Use
refs #42to reference
without closing.
- Squash merge: all commits become one. Branch history is lost. Best for
small PRs.
- Merge conflicts:
git fetch origin && git rebase origin/mainto resolve
before pushing.
- Draft PR:
gh pr create --draftmarks as WIP. Reviewers can't approve
until marked ready.
- Force push:
git push --force-with-lease(not--force) to avoid
overwriting others' work on shared branches.
- CI not triggering: check if branch protection rules require specific
status checks. Some CI only runs on certain branch patterns.