create-pr

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
When creating a PR:
  • Use
    gh pr create
  • Use the target repo's dedicated PR template when one exists.
  • Otherwise, use
    workflow-create-pr/pull_request_template.md
    from this package as the fallback template.
  • Follow merge-queue conventions.
创建PR时:
  • 使用
    gh pr create
  • 如果目标仓库有专用的PR模板,请使用该模板。
  • 否则,使用本包中的
    workflow-create-pr/pull_request_template.md
    作为备用模板。
  • 遵循合并队列规范。

Merge-queue mapping

合并队列映射规则

  • PR title = commit title (Conventional Commits format).
  • PR description = commit body (reusable as commit message content).
  • PR title max: 72 characters.
  • PR description line max: 72 characters, except long URLs, code blocks, or stack traces.
  • PR标题 = 提交标题(Conventional Commits格式)。
  • PR描述 = 提交正文(可复用为提交消息内容)。
  • PR标题最大长度:72个字符。
  • PR描述每行最大长度:72个字符,长URL、代码块或堆栈跟踪除外。

Description rules

描述规则

  • The first line must be plain context text describing the change.
  • After the context line, follow the selected template.
  • If the target repo has a dedicated PR template, follow that template after the context line.
  • Otherwise, append the sections from
    workflow-create-pr/pull_request_template.md
    after the context line.
  • Do not add extra headings beyond those required by the selected template.
  • Fill
    CONFIG-CHANGE:
    and
    BREAKING-CHANGE:
    sections when applicable.
  • Remove
    CONFIG-CHANGE:
    and/or
    BREAKING-CHANGE:
    sections entirely if there is no config change or breaking change respectively.
  • Keep the description concise and commit-friendly.
  • 第一行必须是描述变更的纯上下文文本。
  • 上下文行之后,遵循所选模板的要求。
  • 如果目标仓库有专用的PR模板,在上下文行之后遵循该模板的要求。
  • 否则,在上下文行之后追加
    workflow-create-pr/pull_request_template.md
    中的章节。
  • 请勿添加所选模板要求之外的额外标题。
  • 适用的情况下,请填写
    CONFIG-CHANGE:
    BREAKING-CHANGE:
    章节。
  • 如果没有配置变更或破坏性变更,请分别完全删除
    CONFIG-CHANGE:
    和/或
    BREAKING-CHANGE:
    章节。
  • 保持描述简洁,符合提交友好的要求。

Steps

操作步骤

  1. Run the
    verify
    skill
    if it has not been run since the last code change. All matching checks must pass before proceeding.
  2. Review all commits on the branch (
    git log
    and
    git diff
    against the base branch).
  3. Draft a PR title (Conventional Commits format, 72 chars max).
  4. Draft a PR description that starts with a plain context line.
  5. If the target repo has a dedicated PR template, follow that template after the context line; otherwise append
    workflow-create-pr/pull_request_template.md
    after the context line.
  6. Ask for confirmation from the user with all this information.
  7. Check if the branch needs to be pushed to remote.
  8. Create the PR.
  9. Return the PR URL.
  1. 如果上次代码变更后尚未运行**
    verify
    skill**,请先运行。所有相关检查必须全部通过后才能继续后续操作。
  2. 检查分支上的所有提交(执行
    git log
    以及与基准分支对比的
    git diff
    )。
  3. 起草PR标题(Conventional Commits格式,最多72个字符)。
  4. 起草PR描述,以纯上下文行开头。
  5. 如果目标仓库有专用的PR模板,在上下文行之后遵循该模板要求;否则在上下文行之后追加
    workflow-create-pr/pull_request_template.md
    内容。
  6. 向用户展示所有上述信息,请求确认。
  7. 检查分支是否需要推送到远程仓库。
  8. 创建PR。
  9. 返回PR的URL。