create-pr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreate GitHub Pull Request
创建GitHub拉取请求(PR)
Execute automated PR creation workflow with comprehensive quality validation and security scanning.
执行自动化PR创建工作流,包含全面的质量验证和安全扫描。
Context
上下文
- Current git status: !
git status - Current branch: !
git branch --show-current - Unpushed commits: !
git log @{u}..HEAD --oneline 2>/dev/null || git log --oneline -5 - GitHub authentication: !
gh auth status - Repository changes: !
git diff --stat HEAD~1..HEAD 2>/dev/null || echo "No recent changes"
- 当前Git状态:!
git status - 当前分支:!
git branch --show-current - 未推送的提交:!
git log @{u}..HEAD --oneline 2>/dev/null || git log --oneline -5 - GitHub身份验证状态:!
gh auth status - 仓库变更:!
git diff --stat HEAD~1..HEAD 2>/dev/null || echo "No recent changes"
Requirements Summary
需求概述
Ensure repository readiness with clean state and authentication. Complete all quality checks (lint, test, build, security) before PR creation. Link related issues with auto-closing keywords and apply accurate labels. See for complete checklist.
references/requirements.md确保仓库处于就绪状态,包括干净的工作区和有效的身份验证。在创建PR前完成所有质量检查(代码检查、测试、构建、安全扫描)。使用自动关闭关键词关联相关问题,并添加准确的标签。完整检查清单请参见。
references/requirements.mdPhase 1: Validation and Analysis
阶段1:验证与分析
Goal: Validate repository state, analyze changes, and identify blockers.
Actions:
- Verify GitHub authentication from context
- Check branch status and unpushed commits
- Analyze commit history for conventional commit compliance
- Identify changed files and determine PR scope
- Detect potential blockers (merge conflicts, missing tests, etc.)
目标:验证仓库状态,分析变更内容,识别潜在障碍。
操作:
- 根据上下文验证GitHub身份验证状态
- 检查分支状态和未推送的提交
- 分析提交历史是否符合规范提交格式
- 识别变更文件并确定PR的范围
- 检测潜在障碍(如合并冲突、缺失测试等)
Phase 2: Quality and Security Checks
阶段2:质量与安全检查
Goal: Execute comprehensive quality validation and security scanning.
Actions:
- Run project-specific quality checks (see for commands)
references/quality-validation.md - Execute security scanning for sensitive files and hardcoded secrets
- Validate commit message format against standards
- If checks fail: follow failure resolution process in
references/failure-resolution.md - Re-run all checks until passing
目标:执行全面的质量验证和安全扫描。
操作:
- 运行项目专属的质量检查(命令请参见)
references/quality-validation.md - 执行敏感文件和硬编码密钥的安全扫描
- 验证提交消息格式是否符合标准
- 如果检查失败:遵循中的故障解决流程
references/failure-resolution.md - 重新运行所有检查直至通过
Phase 3: PR Assembly and Creation
阶段3:PR组装与创建
Goal: Create pull request with proper structure, metadata, and links.
Actions:
- Identify and link related issues using GitHub CLI
- Generate PR title (≤70 chars, imperative, no emojis)
- Assemble PR body following template in
references/pr-structure.md - Apply automated labels based on file changes
- Create PR using with all metadata
gh pr create - Report final PR URL and status to user
目标:创建结构规范、包含元数据和关联链接的拉取请求。
操作:
- 使用GitHub CLI识别并关联相关问题
- 生成PR标题(≤70字符,祈使语气,不含表情符号)
- 按照中的模板组装PR正文
references/pr-structure.md - 根据文件变更自动添加标签
- 使用命令创建包含所有元数据的PR
gh pr create - 向用户报告最终的PR URL和状态
References
参考资料
- Requirements: - Pre-creation checklist and commit standards
references/requirements.md - Quality Validation: - Node.js/Python validation commands
references/quality-validation.md - PR Structure: - Title guidelines, body template, labels
references/pr-structure.md - Failure Resolution: - Agent collaboration for fixing failures
references/failure-resolution.md - Examples: - Commit message examples
references/examples.md
- 需求:- PR创建前的检查清单和提交标准
references/requirements.md - 质量验证:- Node.js/Python验证命令
references/quality-validation.md - PR结构:- 标题规范、正文模板、标签规则
references/pr-structure.md - 故障解决:- 协作修复故障的流程
references/failure-resolution.md - 示例:- 提交消息示例
references/examples.md