create-pr

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Create Pull Request

创建GitHub拉取请求

Creates GitHub PRs with titles that pass n8n's
check-pr-title
CI validation.
创建符合n8n的
check-pr-title
CI验证要求的GitHub PR。

PR Title Format

PR标题格式

<type>(<scope>): <summary>
<type>(<scope>): <summary>

Types (required)

类型(必填)

TypeDescriptionChangelog
feat
New featureYes
fix
Bug fixYes
perf
Performance improvementYes
test
Adding/correcting testsNo
docs
Documentation onlyNo
refactor
Code change (no bug fix or feature)No
build
Build system or dependenciesNo
ci
CI configurationNo
chore
Routine tasks, maintenanceNo
类型描述更新日志
feat
新功能
fix
Bug修复
perf
性能优化
test
添加/修正测试用例
docs
仅文档变更
refactor
代码重构(无Bug修复或新功能)
build
构建系统或依赖项变更
ci
CI配置变更
chore
日常任务、维护工作

Scopes (optional but recommended)

范围(可选但推荐)

  • API
    - Public API changes
  • benchmark
    - Benchmark CLI changes
  • core
    - Core/backend/private API
  • editor
    - Editor UI changes
  • * Node
    - Specific node (e.g.,
    Slack Node
    ,
    GitHub Node
    )
  • API
    - 公开API变更
  • benchmark
    - Benchmark CLI变更
  • core
    - 核心/后端/私有API变更
  • editor
    - 编辑器UI变更
  • * Node
    - 特定节点(例如
    Slack Node
    GitHub Node

Summary Rules

摘要规则

  • Use imperative present tense: "Add" not "Added"
  • Capitalize first letter
  • No period at the end
  • No ticket IDs (e.g., N8N-1234)
  • Add
    (no-changelog)
    suffix to exclude from changelog
  • 使用祈使句现在时态:用“Add”而非“Added”
  • 首字母大写
  • 结尾无句号
  • 不包含工单ID(例如N8N-1234)
  • 若需排除在更新日志外,添加
    (no-changelog)
    后缀

Steps

步骤

  1. Check current state:
    bash
    git status
    git diff --stat
    git log origin/master..HEAD --oneline
  2. Analyze changes to determine:
    • Type: What kind of change is this?
    • Scope: Which package/area is affected?
    • Summary: What does the change do?
  3. Push branch if needed:
    bash
    git push -u origin HEAD
  4. Create PR using gh CLI with the template from
    .github/pull_request_template.md
    :
    bash
    gh pr create --draft --title "<type>(<scope>): <summary>" --body "$(cat <<'EOF'
    ## Summary
    
    <Describe what the PR does and how to test. Photos and videos are recommended.>
    
    ## Related Linear tickets, Github issues, and Community forum posts
    
    <!-- Link to Linear ticket: https://linear.app/n8n/issue/[TICKET-ID] -->
    <!-- Use "closes #<issue-number>", "fixes #<issue-number>", or "resolves #<issue-number>" to automatically close issues -->
    
    ## Review / Merge checklist
    
    - [ ] PR title and summary are descriptive. ([conventions](../blob/master/.github/pull_request_title_conventions.md))
    - [ ] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up ticket created.
    - [ ] Tests included.
    - [ ] PR Labeled with `release/backport` (if the PR is an urgent fix that needs to be backported)
    EOF
    )"
  1. 检查当前状态
    bash
    git status
    git diff --stat
    git log origin/master..HEAD --oneline
  2. 分析变更以确定:
    • 类型:此次变更属于哪种类型?
    • 范围:变更影响哪个包/区域?
    • 摘要:变更实现了什么功能?
  3. 如有需要,推送分支
    bash
    git push -u origin HEAD
  4. 使用gh CLI并基于
    .github/pull_request_template.md
    模板创建PR
    bash
    gh pr create --draft --title "<type>(<scope>): <summary>" --body "$(cat <<'EOF'
    ## Summary
    
    <Describe what the PR does and how to test. Photos and videos are recommended.>
    
    ## Related Linear tickets, Github issues, and Community forum posts
    
    <!-- Link to Linear ticket: https://linear.app/n8n/issue/[TICKET-ID] -->
    <!-- Use "closes #<issue-number>", "fixes #<issue-number>", or "resolves #<issue-number>" to automatically close issues -->
    
    ## Review / Merge checklist
    
    - [ ] PR title and summary are descriptive. ([conventions](../blob/master/.github/pull_request_title_conventions.md))
    - [ ] [Docs updated](https://github.com/n8n-io/n8n-docs) or follow-up ticket created.
    - [ ] Tests included.
    - [ ] PR Labeled with `release/backport` (if the PR is an urgent fix that needs to be backported)
    EOF
    )"

PR Body Guidelines

PR正文指南

Based on
.github/pull_request_template.md
:
基于
.github/pull_request_template.md

Summary Section

摘要部分

  • Describe what the PR does
  • Explain how to test the changes
  • Include screenshots/videos for UI changes
  • 描述PR的功能
  • 说明如何测试变更
  • 若为UI变更,包含截图/视频

Related Links Section

相关链接部分

  • Link to Linear ticket:
    https://linear.app/n8n/issue/[TICKET-ID]
  • Link to GitHub issues using keywords to auto-close:
    • closes #123
      /
      fixes #123
      /
      resolves #123
  • Link to Community forum posts if applicable
  • 链接至Linear工单:
    https://linear.app/n8n/issue/[TICKET-ID]
  • 使用关键词链接GitHub issues以自动关闭:
    • closes #123
      /
      fixes #123
      /
      resolves #123
  • 如有需要,链接至社区论坛帖子

Checklist

检查清单

All items should be addressed before merging:
  • PR title follows conventions
  • Docs updated or follow-up ticket created
  • Tests included (bugs need regression tests, features need coverage)
  • release/backport
    label added if urgent fix needs backporting
合并前需完成所有项:
  • PR标题符合规范
  • 文档已更新或已创建后续工单
  • 包含测试用例(Bug需添加回归测试,功能需覆盖测试)
  • 若为紧急修复需向后移植,添加
    release/backport
    标签

Examples

示例

Feature in editor

编辑器中的新功能

feat(editor): Add workflow performance metrics display
feat(editor): Add workflow performance metrics display

Bug fix in core

核心模块Bug修复

fix(core): Resolve memory leak in execution engine
fix(core): Resolve memory leak in execution engine

Node-specific change

特定节点变更

fix(Slack Node): Handle rate limiting in message send
fix(Slack Node): Handle rate limiting in message send

Breaking change (add exclamation mark before colon)

破坏性变更(冒号前添加感叹号)

feat(API)!: Remove deprecated v1 endpoints
feat(API)!: Remove deprecated v1 endpoints

No changelog entry

无需更新日志

refactor(core): Simplify error handling (no-changelog)
refactor(core): Simplify error handling (no-changelog)

No scope (affects multiple areas)

无范围(影响多个区域)

chore: Update dependencies to latest versions
chore: Update dependencies to latest versions

Validation

验证规则

The PR title must match this pattern:
^(feat|fix|perf|test|docs|refactor|build|ci|chore|revert)(\([a-zA-Z0-9 ]+( Node)?\))?!?: [A-Z].+[^.]$
Key validation rules:
  • Type must be one of the allowed types
  • Scope is optional but must be in parentheses if present
  • Exclamation mark for breaking changes goes before the colon
  • Summary must start with capital letter
  • Summary must not end with a period
PR标题必须匹配以下模式:
^(feat|fix|perf|test|docs|refactor|build|ci|chore|revert)(\([a-zA-Z0-9 ]+( Node)?\))?!?: [A-Z].+[^.]$
关键验证规则:
  • 类型必须为允许的类型之一
  • 范围为可选,但如果存在必须放在括号内
  • 破坏性变更需在冒号前添加感叹号
  • 摘要必须以大写字母开头
  • 摘要结尾不得有句号