-
Notifications
You must be signed in to change notification settings - Fork 0
/
.mergify.yml
104 lines (101 loc) · 2.8 KB
/
.mergify.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
queue_rules:
- name: shared_queue
conditions:
# - '#check-pending=0'
- '#check-success>=2'
- check-success=fmt
- check-success=test
pull_request_rules:
- name: delete head branch after merge
conditions:
- merged
actions:
delete_head_branch:
# Push PR into queue when it passes all checks
- name: put approved pr to queue
conditions:
- or:
- and:
- "#approved-reviews-by>=1"
- "#changes-requested-reviews-by=1"
- -draft
- check-success=fmt
- check-success=test
- and:
- label=merge-by-owner
- -draft
- check-success=fmt
- check-success=test
actions:
queue:
name: shared_queue
method: squash
# Check if PR title contain valid types
- name: Comment PR if title not semantic
conditions:
- author!=Mergify
- -draft
- '-title~=^(feat|fix|refactor|ci|build|docs|website|chore)(\(.*\))?:'
actions:
comment:
message: |
This pull request's title is not fulfill the requirements. @{{author}} please update it 🙏.
Valid format:
```
fix(query): fix group by string bug
^ ^---------------------^
| |
| +-> Summary in present tense.
|
+-------> Type: feat, fix, refactor, ci, build, docs, website, chore
```
Valid types:
- `feat`: this PR introduces a new feature to the codebase
- `fix`: this PR patches a bug in codebase
- `refactor`: this PR changes the code base without new features or bugfix
- `ci|build`: this PR changes build/testing/ci steps
- `docs|website`: this PR changes the documents or websites
- `chore`: this PR only has small changes that no need to record
# Assign pr label based of tags
- name: label on New Feature
conditions:
- 'title~=^(feat)(\(.*\))?:'
actions:
label:
add:
- pr-feature
- name: label on Bug Fix
conditions:
- 'title~=^(fix)(\(.*\))?:'
actions:
label:
add:
- pr-bugfix
- name: label on Refactor
conditions:
- 'title~=^(refactor)(\(.*\))?:'
actions:
label:
add:
- pr-refactor
- name: label on Build/Testing/CI
conditions:
- 'title~=^(ci|build)(\(.*\))?:'
actions:
label:
add:
- pr-build
- name: label on Documentation
conditions:
- 'title~=^(docs|website)(\(.*\))?:'
actions:
label:
add:
- pr-doc
- name: label on Not for changelog
conditions:
- 'title~=^(chore)(\(.*\))?:'
actions:
label:
add:
- pr-chore