1k-create-pr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreate OneKey App PR
创建OneKey应用PR
Automates the complete PR creation workflow for OneKey app-monorepo changes.
自动处理OneKey应用单体仓库代码变更的完整PR创建流程。
Quick Reference
快速参考
| Step | Action | Commands |
|---|---|---|
| 1 | Check status | |
| 2 | Create branch (if on x) | |
| 3 | Stage & commit | |
| 4 | Push to remote | |
| 5 | Create PR | |
| 6 | Enable auto-merge | |
| 步骤 | 操作 | 命令 |
|---|---|---|
| 1 | 检查状态 | |
| 2 | 创建分支(若当前在x分支) | |
| 3 | 暂存并提交 | |
| 4 | 推送到远程仓库 | |
| 5 | 创建PR | |
| 6 | 启用自动合并 | |
Workflow
工作流程
1. Check Current Branch Status
1. 检查当前分支状态
bash
git status
git branch --show-currentbash
git status
git branch --show-current2. Branch Handling
2. 分支处理
If on branch:
x- Analyze current changes (staged and unstaged)
- Generate descriptive branch name based on changes:
- - new features
feat/ - - bug fixes
fix/ - - refactoring
refactor/ - - maintenance tasks
chore/
- Create and switch:
git checkout -b <branch-name>
If already on feature branch: Skip branch creation
若当前位于分支:
x- 分析当前变更(已暂存和未暂存的内容)
- 根据变更生成描述性分支名称:
- - 新功能
feat/ - - 漏洞修复
fix/ - - 代码重构
refactor/ - - 维护任务
chore/
- 创建并切换分支:
git checkout -b <branch-name>
若已在功能分支上: 跳过分支创建步骤
3. Stage and Commit Changes
3. 暂存并提交变更
bash
git add .
git commit -m "<type>: <description>"Commit format:
- Follow conventional commits
- Do NOT add Claude signatures or Co-Authored-By
bash
git add .
git commit -m "<type>: <description>"提交格式要求:
- 遵循约定式提交规范
- 请勿添加Claude签名或Co-Authored-By信息
4. Push to Remote
4. 推送到远程仓库
bash
git push -u origin <branch-name>bash
git push -u origin <branch-name>5. Create Pull Request
5. 创建Pull Request
bash
gh pr create --base x --title "<title>" --body "<description>"Issue ID handling:
- Extract from commit summary/description
OK-{number} - Append to PR title:
fix: description(OK-49185) - No space before opening parenthesis
bash
gh pr create --base x --title "<title>" --body "<description>"Issue ID处理规则:
- 从提交摘要/描述中提取格式的Issue ID
OK-{number} - 将其追加到PR标题末尾:
fix: description(OK-49185) - 左括号前无空格
6. Enable Auto-Merge
6. 启用自动合并
bash
gh pr update-branch <PR_NUMBER>
gh pr merge <PR_NUMBER> --auto --squashbash
gh pr update-branch <PR_NUMBER>
gh pr merge <PR_NUMBER> --auto --squash7. Return PR URL
7. 返回PR链接
Display PR URL to user and optionally open in browser:
bash
open <PR_URL>向用户展示PR链接,可选择在浏览器中打开:
bash
open <PR_URL>Important Notes
重要注意事项
- Always target as base branch
x - Use conventional commit format:
type: description - Extract and append issue IDs (OK-{number}) to PR title
- 始终以分支为目标基准分支
x - 使用约定式提交格式:
type: description - 提取并将Issue ID(OK-{number})追加到PR标题中