diff --git a/.mergify.yml b/.mergify.yml index c8740485..66d243c3 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -5,25 +5,18 @@ queue_rules: - check-success=Commit Lint pull_request_rules: - # 自动合并 Dependabot 的 patch 版本更新 - - name: 自动合并 Dependabot patch 更新 + # 自动合并 Dependabot 的更新 + - name: 自动合并 Dependabot 更新 conditions: - author=dependabot[bot] - check-success=CI - check-success=Commit Lint - - title~=^build\(deps\): bump .* from .* to .* - - files~=^package-lock\.json$ actions: review: type: APPROVE - message: 自动批准 Dependabot 的 patch 更新 + message: 自动批准 Dependabot 更新 queue: name: default - method: squash - commit_message_template: | - {{ title }} (#{{ number }}) - - {{ body }} # 自动合并有 'automerge' 标签且测试通过的 PR - name: 自动合并标记的 PR @@ -36,28 +29,26 @@ pull_request_rules: actions: queue: name: default - method: squash - # 自动给小 PR 添加标签 + # 自动给小 PR 添加标签(根据文件数) - name: 标记小 PR 方便快速 Review conditions: - - files<=3 - - lines<=50 + - "#files<=3" actions: label: add: - quick-review - # 提醒大 PR 需要拆分 + # 提醒大 PR 需要拆分(根据文件数) - name: 提醒大 PR conditions: - - lines>1000 + - "#files>=20" actions: comment: message: | - ⚠️ 这个 PR 改动超过 1000 行,建议拆分成多个小 PR,便于 Review 和测试。 + ⚠️ 这个 PR 改动了较多文件(20+ 个),建议拆分成多个小 PR,便于 Review 和测试。 - ⚠️ This PR has over 1000 lines changed. Consider splitting it into smaller PRs for easier review and testing. + ⚠️ This PR modifies many files (20+). Consider splitting it into smaller PRs for easier review and testing. # 自动更新过期的分支 - name: 自动更新过期分支 @@ -67,18 +58,22 @@ pull_request_rules: - base=master - "#approved-reviews-by>=1" actions: - update: - method: rebase + update: {} - # 感谢首次贡献者 - - name: 感谢新贡献者 + # 自动添加标签 + - name: 添加 dependencies 标签 conditions: - - author!=dependabot[bot] - - author!=dependabot-preview[bot] - - "#commits-behind=0" + - author=dependabot[bot] actions: - comment: - message: | - 🎉 感谢你的贡献!我们会尽快 Review。 + label: + add: + - dependencies - 🎉 Thanks for your contribution! We'll review it soon. + # 标记需要关注的 PR + - name: 标记需要更新的 PR + conditions: + - "#commits-behind>10" + actions: + label: + add: + - needs-rebase