From bee2358783483330affa334611670e58dd6b4ff9 Mon Sep 17 00:00:00 2001 From: Phoenix Date: Tue, 16 Apr 2024 20:14:05 +0800 Subject: [PATCH] ci(Mergify): configuration update Signed-off-by: Phoenix --- .mergify.yml | 70 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 61 insertions(+), 9 deletions(-) diff --git a/.mergify.yml b/.mergify.yml index 7d73e3c35..e3375084b 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -1,15 +1,67 @@ pull_request_rules: - name: Automatic merge on approval conditions: - - "#approved-reviews-by>=2" - - check-success=Validation - - check-success=Tests Normal - - check-success=Tests Madsim - - check-success=Commit Message Validation - - check-success=Spell Check - - check-success=DCO - - status-success="codecov/patch" - - status-success="codecov/project" + - or: + - "#approved-reviews-by >= 2" + - and: + - author = dependabot[bot] + - "#approved-reviews-by>=1" + - or: + - "#check-failure=0" + - and: + - "#check-failure=1" + - check-failure="codecov/patch" + - and: + - "#check-failure=1" + - check-failure="codecov/project" + - and: + - "#check-failure=2" + - check-failure="codecov/patch" + - check-failure="codecov/project" actions: merge: method: rebase + + - name: convert to draft + conditions: + - and: + - "#check-failure>0" + - check-failure="codecov/patch" + - check-failure="codecov/project" + actions: + comment: + message: "@{{author}} Convert your pr to draft since CI failed" + edit: + draft: true + + - name: automatic approval for Dependabot pull requests + conditions: + - author=dependabot[bot] + actions: + review: + type: APPROVE + message: Automatically approving dependabot + + - name: comment when a pull request is merged + conditions: + - conflict + actions: + comment: + message: "@{{author}} Your PR is in conflict and cannot be merged." + + - name: rebase pull request when it's more than 10 commits behind main + conditions: + - base=main + - "#commits-behind>=10" + actions: + rebase: + + - name: balanced review assignment + conditions: + - base=main + - author!=dependabot[bot] + actions: + request_reviews: + teams: + - "@XlineTeam" + random_count: 2