用途:向 oceanbase/oceanbase-design 仓库提交或更新 PR,适用于本地分支已推送到 origin、需要开 PR 到 master 或指定 base 的场景,并按仓库模板填写标题、描述与自检项。
前置条件:已安装并登录 GitHub CLI(gh auth status 成功);远程为 github.com/oceanbase/oceanbase-design;当前工作目录为仓库根目录。若刚做过 rebase 或修改历史,需先执行 git push --force-with-lease origin <branch> 再开或更新 PR。
标题:使用英文单行,格式与历史 PR 一致,如 type(scope): short description(chore(ci): …、fix(design): …、feat(ui): …);type 常见 feat、fix、chore、docs、improve,scope 可为包名或区域。
描述:遵循 .github/PULL_REQUEST_TEMPLATE.md,勾选 Modified package、This is a... 等对应项,填写 Background and solution、Changelog 中英表格,无关联 issue 写 N/A,并勾选 Self-Check before Merge。可将正文存为临时文件后传入: gh pr create --repo oceanbase/oceanbase-design --base master --head <你的分支名> --title "type(scope): English title here" --body-file path/to/body.md 查看现有 PR:gh pr list --head <你的分支名> --base master;gh pr view <number> --web。
标签(可选):CI 可能通过 PR Labeler(.github/labeler.yml,工作流 pull_request_target)按变更路径自动加标签;手动补打示例:gh pr edit <PR_NUMBER> --repo oceanbase/oceanbase-design --add-label "chore" --add-label "workflow"。标签名须与仓库已有 Labels 完全一致,无权限创建新标签时只加已有项。
合并提交:如需压缩多次提交,可用 git reset --soft HEAD~<N>、git commit -m "type(scope): single final message"、git push --force-with-lease origin <branch>。
无 gh 时后备:浏览器打开 https://github.com/oceanbase/oceanbase-design/compare/master...<分支名>?expand=1,粘贴模板内容。
限制与反模式:不要在仓库中长期保留 body.md 等仅用于 gh 的临时文件,用毕删除且勿加入版本控制。