|
| 1 | +# https://docs.mergify.io/conditions.html |
| 2 | +# https://docs.mergify.io/actions.html |
| 3 | +pull_request_rules: |
| 4 | +- name: "approve automated PRs that have passed checks" |
| 5 | + conditions: |
| 6 | + - "author~=^(cloudpossebot|renovate\\[bot\\])$" |
| 7 | + - "-closed" |
| 8 | + - "head~=^(auto-update|renovate)/.*" |
| 9 | + - "check-success=test/bats" |
| 10 | + - "check-success=test/readme" |
| 11 | + - "check-success=test/terratest" |
| 12 | + - "check-success=validate-codeowners" |
| 13 | + - or: |
| 14 | + - "base=master" |
| 15 | + - "base=main" |
| 16 | + - "base~=^release/v\\d{1,2}$" |
| 17 | + |
| 18 | + actions: |
| 19 | + review: |
| 20 | + type: "APPROVE" |
| 21 | + bot_account: "cloudposse-mergebot" |
| 22 | + message: "We've automatically approved this PR because the checks from the automated Pull Request have passed." |
| 23 | + |
| 24 | +- name: "merge automated PRs when approved and tests pass" |
| 25 | + conditions: |
| 26 | + - "author~=^(cloudpossebot|renovate\\[bot\\])$" |
| 27 | + - "-closed" |
| 28 | + - "head~=^(auto-update|renovate)/.*" |
| 29 | + - "check-success=test/bats" |
| 30 | + - "check-success=test/readme" |
| 31 | + - "check-success=test/terratest" |
| 32 | + - "check-success=validate-codeowners" |
| 33 | + - "#approved-reviews-by>=1" |
| 34 | + - "#changes-requested-reviews-by=0" |
| 35 | + - "#commented-reviews-by=0" |
| 36 | + - or: |
| 37 | + - "base=master" |
| 38 | + - "base=main" |
| 39 | + - "base~=^release/v\\d{1,2}$" |
| 40 | + |
| 41 | + actions: |
| 42 | + merge: |
| 43 | + method: "squash" |
| 44 | + |
| 45 | +- name: "delete the head branch after merge" |
| 46 | + conditions: |
| 47 | + - "merged" |
| 48 | + actions: |
| 49 | + delete_head_branch: {} |
| 50 | + |
| 51 | +- name: "ask to resolve conflict" |
| 52 | + conditions: |
| 53 | + - "conflict" |
| 54 | + - "-closed" |
| 55 | + actions: |
| 56 | + comment: |
| 57 | + message: "This pull request is now in conflict. Could you fix it @{{author}}? 🙏" |
| 58 | + |
| 59 | +- name: "remove outdated reviews" |
| 60 | + conditions: |
| 61 | + - or: |
| 62 | + - "base=master" |
| 63 | + - "base=main" |
| 64 | + - "base~=^release/v\\d{1,2}$" |
| 65 | + actions: |
| 66 | + dismiss_reviews: |
| 67 | + changes_requested: true |
| 68 | + approved: true |
| 69 | + message: "This Pull Request has been updated, so we're dismissing all reviews." |
| 70 | + |
| 71 | +- name: "close Pull Requests without files changed" |
| 72 | + conditions: |
| 73 | + - "#files=0" |
| 74 | + actions: |
| 75 | + close: |
| 76 | + message: "This pull request has been automatically closed by Mergify because there are no longer any changes." |
0 commit comments