review-pr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseReview PR
审查PR
Review a GitHub pull request, verify CI status, and merge + tag a release if appropriate.
审查GitHub拉取请求,验证CI状态,合适的情况下合并并打上版本标签发布。
Workflow
工作流程
1. Fetch PR details
1. 获取PR详情
Use CLI to get the PR diff, description, and CI status:
ghbash
gh pr view <number> --json title,body,additions,deletions,files,reviews,statusCheckRollup,headRefName,baseRefName
gh pr diff <number>使用 CLI获取PR的差异、描述和CI状态:
ghbash
gh pr view <number> --json title,body,additions,deletions,files,reviews,statusCheckRollup,headRefName,baseRefName
gh pr diff <number>2. Review the changes
2. 审查变更
Carefully review the diff. Pay attention to:
- Code quality and correctness
- Potential bugs or edge cases
- Whether the change matches the PR description
- Test coverage for new functionality
- Adherence to existing code style and patterns in the package
If there are issues, post a review comment via and stop.
gh pr review <number> --request-changes --body "..."仔细审查diff,注意以下要点:
- 代码质量与正确性
- 潜在的Bug或边缘场景
- 变更内容是否与PR描述匹配
- 新功能的测试覆盖率
- 是否符合包的现有代码风格与模式
如果存在问题,通过提交审查评论并终止流程。
gh pr review <number> --request-changes --body "..."3. Check CI status
3. 检查CI状态
All CI checks must be green before merging. Verify via the field from step 1. If CI is failing or pending, inform the user and stop.
statusCheckRollup合并前所有CI检查必须全部通过。通过步骤1返回的字段进行验证。如果CI运行失败或处于待执行状态,告知用户并终止流程。
statusCheckRollup4. Merge and release
4. 合并与发布
If the review looks good and CI is green:
- Merge the PR:
gh pr merge <number> --squash --delete-branch - Determine the appropriate version bump by checking the latest tag:
gh release list --limit 1 - Tag a new release with the next appropriate version number
如果审查通过且CI状态正常:
- 合并PR:
gh pr merge <number> --squash --delete-branch - 检查最新发布标签,确定合适的版本号升级幅度:
gh release list --limit 1 - 使用合适的下一版本号打标签,发布新版本
Versioning rules
版本号规则
- NEVER tag a major version bump without explicit user approval. Always ask first.
- Dropping support for a PHP or Laravel version is NOT a breaking change — use a minor or patch bump.
- New features: minor version bump (e.g. 1.2.0 → 1.3.0)
- Bug fixes, typos, dependency updates: patch version bump (e.g. 1.2.0 → 1.2.1)
- When in doubt about the version bump level, ask the user.
- 未经用户明确批准,绝对不要升级主版本号,务必先询问用户。
- 停止支持某个PHP或Laravel版本不属于破坏性变更——使用次版本号或修订版本号升级即可。
- 新功能:次版本号升级(例如 1.2.0 → 1.3.0)
- Bug修复、拼写错误修正、依赖更新:修订版本号升级(例如 1.2.0 → 1.2.1)
- 如果不确定版本号升级幅度,询问用户。
Creating the release
创建发布
bash
gh release create <tag> --title "<tag>" --generate-notesUse to auto-generate release notes from the merged PR.
--generate-notesbash
gh release create <tag> --title "<tag>" --generate-notes使用参数从已合并的PR自动生成发布说明。
--generate-notes