generated from mrz1836/go-template
-
Notifications
You must be signed in to change notification settings - Fork 10
/
mergify.yml
218 lines (200 loc) · 6.76 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
pull_request_rules:
# ===============================================================================
# DEPENDABOT
# ===============================================================================
- name: Automatic Merge for Dependabot Minor Version Pull Requests
conditions:
- -draft
- author~=^dependabot(|-preview)\[bot\]$
- check-success='test (1.19.x, ubuntu-latest)'
- check-success='Analyze (go)'
actions:
review:
type: APPROVE
message: Automatically approving dependabot pull request
merge:
method: merge
# ===============================================================================
# AUTOMATIC MERGE (APPROVALS)
# ===============================================================================
- name: Automatic Merge ⬇️ on Approval ✔
conditions:
- "#approved-reviews-by>=1"
- "#review-requested=0"
- "#changes-requested-reviews-by=0"
- check-success='test (1.19.x, ubuntu-latest)'
- check-success='Analyze (go)'
- -title~=(?i)wip
- label!=work-in-progress
- -draft
actions:
merge:
method: merge
# ===============================================================================
# AUTHOR
# ===============================================================================
- name: Auto-Assign Author
conditions:
- "#assignee=0"
actions:
assign:
users: ["mrz1836"]
# ===============================================================================
# ALERTS
# ===============================================================================
- name: Notify on merge
conditions:
- merged
- label=automerge
actions:
comment:
message: "✅ @{{author}}: **{{title}}** has been merged successfully."
- name: Alert on merge conflict
conditions:
- conflict
- label=automerge
actions:
comment:
message: "🆘 @{{author}}: `{{head}}` has conflicts with `{{base}}` that must be resolved."
- name: Alert on tests failure for automerge
conditions:
- label=automerge
- status-failure=commit
actions:
comment:
message: "🆘 @{{author}}: unable to merge due to CI failure."
# ===============================================================================
# LABELS
# ===============================================================================
# Automatically add labels when PRs match certain patterns
#
# NOTE:
# - single quotes for regex to avoid accidental escapes
# - Mergify leverages Python regular expressions to match rules.
#
# Semantic commit messages
# - chore: updating grunt tasks etc.; no production code change
# - docs: changes to the documentation
# - feat: feature or story
# - feature: new feature or story
# - fix: bug fix for the user, not a fix to a build script
# - idea: general idea or suggestion
# - question: question regarding code
# - test: test related changes
# - wip: work in progress PR
# ===============================================================================
- name: Work in Progress
conditions:
- "head~=(?i)^wip" # if the PR branch starts with wip/
actions:
label:
add: ["work-in-progress"]
- name: Hotfix label
conditions:
- "head~=(?i)^hotfix" # if the PR branch starts with hotfix/
actions:
label:
add: ["hot-fix"]
- name: Bug / Fix label
conditions:
- "head~=(?i)^(bug)?fix" # if the PR branch starts with (bug)?fix/
actions:
label:
add: ["bug-P3"]
- name: Documentation label
conditions:
- "head~=(?i)^docs" # if the PR branch starts with docs/
actions:
label:
add: ["documentation"]
- name: Feature label
conditions:
- "head~=(?i)^feat(ure)?" # if the PR branch starts with feat(ure)?/
actions:
label:
add: ["feature"]
- name: Chore label
conditions:
- "head~=(?i)^chore" # if the PR branch starts with chore/
actions:
label:
add: ["update"]
- name: Question label
conditions:
- "head~=(?i)^question" # if the PR branch starts with question/
actions:
label:
add: ["question"]
- name: Test label
conditions:
- "head~=(?i)^test" # if the PR branch starts with test/
actions:
label:
add: ["test"]
- name: Idea label
conditions:
- "head~=(?i)^idea" # if the PR branch starts with idea/
actions:
label:
add: ["idea"]
# ===============================================================================
# CONTRIBUTORS
# ===============================================================================
- name: Welcome New Contributors
conditions:
- and:
- author!=dependabot[bot]
- author!=mergify[bot]
- author!=allcontributors[bot]
- author!=mrz1836
- author!=icellan
- author!=dorzepowski
- author!=pawellewandowski98
- author!=arkadiuszos4chain
- author!=wregulski
- author!=mwilkosinski
actions:
comment:
message: "Welcome to our open-source project @{{author}}! 💘"
# ===============================================================================
# STALE BRANCHES
# ===============================================================================
- name: Close stale pull request
conditions:
- base=main
- -closed
- updated-at<21 days ago
actions:
close:
message: |
This pull request looks stale. Feel free to reopen it if you think it's a mistake.
label:
add: ["stale"]
# ===============================================================================
# BRANCHES
# ===============================================================================
- name: Delete head branch after merge
conditions:
- merged
actions:
delete_head_branch:
# ===============================================================================
# CONVENTION
# ===============================================================================
# https://www.conventionalcommits.org/en/v1.0.0/
# Premium feature only
#- name: Conventional Commit
# conditions:
# - "title~=^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\\(.+\\))?:"
# actions:
# post_check:
# title: |
# {% if check_succeed %}
# Title follows Conventional Commit
# {% else %}
# Title does not follow Conventional Commit
# {% endif %}
# summary: |
# {% if not check_succeed %}
# Your pull request title must follow [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/).
# {% endif %}