pr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePull Request
Pull Request
Create pull requests with proper templates and metadata.
使用规范的模板和元数据创建Pull Request。
Requirements
要求
- PR should use the PR template of the current repository
- Assignee is automatically set by CI (random CODEOWNER)
- Labels are automatically applied by CI based on changed files
- PR 需使用当前仓库的PR模板
- 负责人由CI自动设置(随机选择CODEOWNER)
- CI会根据变更的文件自动添加标签
Issue Detection
关联问题检测
If the branch name contains an issue number (e.g., ,
), extract it and fetch the issue details:
feat/123-add-featurefix/45-parser-crashbash
gh issue view <number> --json title,body,labelsUse the issue context to:
- Link the issue using the Closes section format (see below)
- Inform the PR summary and description from the issue's title and body
If no issue number is found in the branch name, skip this step.
如果分支名称包含问题编号(例如:、),请提取该编号并获取问题详情:
feat/123-add-featurefix/45-parser-crashbash
gh issue view <number> --json title,body,labels利用问题上下文完成以下操作:
- 使用Closes章节格式关联问题(见下文)
- 根据问题的标题和内容完善PR的摘要和描述
如果分支名称中未找到问题编号,则跳过此步骤。
Issue Link Format
问题关联格式
Always use this exact format when linking issues in a PR body. Replace the
repo's template section with a section:
## Related Issues## Closesmarkdown
undefined在PR正文中关联问题时,请务必使用以下格式。将仓库模板中的章节替换为章节:
## Related Issues## Closesmarkdown
undefinedCloses
Closes
- Closes #123
- Closes #456
- Relates to #789
This format ensures GitHub renders rich issue links (with title, status, etc.)
automatically. Do **not** append the issue title after the number — GitHub
handles that via its rich formatting.
Rules:
- Use a `## Closes` heading (not `## Related Issues`)
- Each link is a bullet point: `- Closes #<number>`
- Use `Relates to` instead of `Closes` for issues that are related but not
fully resolved by this PR
- Do **not** add any text after the issue number (no titles, no descriptions)- Closes #123
- Closes #456
- Relates to #789
此格式可确保GitHub自动渲染富文本问题链接(包含标题、状态等信息)。**请勿**在编号后附加问题标题——GitHub会通过富文本格式自动处理。
规则:
- 使用`## Closes`标题(而非`## Related Issues`)
- 每个链接为项目符号:`- Closes #<number>`
- 对于相关但未被PR完全解决的问题,使用`Relates to`替代`Closes`
- **请勿**在问题编号后添加任何文本(无标题、无描述)Usage
使用方法
When asked to create a PR:
-
Ensure pre-commit checks pass (lint, test, Docker if applicable)
-
Push the branch to remote
-
Detect associated issue from branch name (see above)
-
Read the repo's PR template: look for
.github/PULL_REQUEST_TEMPLATE.md -
Fill in the PR template with actual content:
- Summary: Concise description of what the PR does and why
- Type: Check the matching type checkbox (feat, fix, test, etc.)
- Changes Made: Bullet list of specific changes
- Closes: Replace with
## Related Issuessection using the issue link format specified above## Closes - Testing: Check boxes for tests that were added/run
- Quality Checks: Check boxes for lint/format/build that passed
- Checklist: Check all applicable items
- Leave sections like Breaking Changes, Screenshots, Deployment Notes with their placeholder comments if not applicable
-
Create the PR:bash
gh pr create --title "<title>" --body "<filled template>"Use a HEREDOC for the body to preserve formatting.
Important: Do NOT use — it only uses the commit
message and skips the PR template entirely. Always read and fill the template.
gh pr create --fillNote: Assignees and labels are handled automatically by GitHub Actions:
- - Assigns a random CODEOWNER
pr-auto-assign.yml - - Labels based on changed files (see
pr-labeler.yml).github/labeler.yml
当需要创建PR时:
-
确保预提交检查通过(代码检查、测试、Docker<如果适用>)
-
将分支推送到远程仓库
-
从分支名称中检测关联问题(见上文)
-
阅读仓库的PR模板:查找文件
.github/PULL_REQUEST_TEMPLATE.md -
填写PR模板并补充实际内容:
- 摘要:简洁描述PR的功能和目的
- 类型:勾选匹配的类型复选框(feat、fix、test等)
- 变更内容:列出具体变更的项目符号
- Closes:将替换为
## Related Issues章节,并使用上述指定的问题关联格式## Closes - 测试:勾选已添加/执行的测试对应的复选框
- 质量检查:勾选已通过的代码检查/格式化/构建对应的复选框
- 检查清单:勾选所有适用的项
- 如果不适用,保留诸如Breaking Changes、Screenshots、Deployment Notes等章节的占位符注释
-
创建PR:bash
gh pr create --title "<title>" --body "<filled template>"使用HEREDOC来保留正文格式。
重要提示:请勿使用——该命令仅使用提交信息,完全跳过PR模板。请务必阅读并填写模板。
gh pr create --fill注意:负责人和标签由GitHub Actions自动处理:
- - 随机分配一位CODEOWNER
pr-auto-assign.yml - - 根据变更的文件添加标签(详见
pr-labeler.yml).github/labeler.yml
Checklist
检查清单
Before creating PR:
- All linting passes
- All tests pass
- Branch is pushed to remote
- Associated issue detected and linked (if branch has issue number)
- PR template read and filled with actual content
- PR created with filled template (not )
--fill
创建PR前:
- 所有代码检查已通过
- 所有测试已通过
- 分支已推送到远程仓库
- 已检测并关联相关问题(如果分支包含问题编号)
- 已阅读PR模板并填写实际内容
- 使用填写好的模板创建PR(未使用)
--fill