github

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GitHub

GitHub

Overview

概述

Use the GitHub CLI to create PRs, review checks, and inspect CI logs. Follow the repo conventions for commits and PR titles.
使用GitHub CLI创建PR、审查检查项并查看CI日志。遵循仓库的提交与PR标题规范。

Commit conventions

提交规范

Use Conventional Commits:
fix(bumba): stabilize workflows
Example:
fix(bumba): stabilize workflows
采用Conventional Commits规范:
fix(bumba): stabilize workflows
示例:
fix(bumba): stabilize workflows

Create a PR

创建PR

  1. Copy
    .github/PULL_REQUEST_TEMPLATE.md
    to a temp file.
  2. Fill it out.
  3. Create the PR with
    gh pr create
    .
bash
cp .github/PULL_REQUEST_TEMPLATE.md /tmp/pr.md
$EDITOR /tmp/pr.md
gh pr create --body-file /tmp/pr.md
  1. .github/PULL_REQUEST_TEMPLATE.md
    复制到临时文件。
  2. 填写模板内容。
  3. 使用
    gh pr create
    命令创建PR。
bash
cp .github/PULL_REQUEST_TEMPLATE.md /tmp/pr.md
$EDITOR /tmp/pr.md
gh pr create --body-file /tmp/pr.md

Check CI

检查CI

bash
gh pr checks 2259
gh run view 123456789 --log
bash
gh pr checks 2259
gh run view 123456789 --log

Merge

合并PR

Use squash merge, do not delete the branch via CLI:
bash
gh pr merge 2202 --squash -R proompteng/lab
采用squash merge(压缩合并)方式,不要通过CLI删除分支:
bash
gh pr merge 2202 --squash -R proompteng/lab

Resources

参考资源

  • Reference:
    references/github-pr-guide.md
  • Helper:
    scripts/create-pr.sh
  • Sample PR body:
    assets/pr-body-template.md
  • 参考文档:
    references/github-pr-guide.md
  • 辅助脚本:
    scripts/create-pr.sh
  • PR正文示例:
    assets/pr-body-template.md