1+ pull_request_rules :
2+
3+ # ===============================================================================
4+ # DEPENDABOT
5+ # ===============================================================================
6+
7+ - name : Automatic Merge for Dependabot Minor Version Pull Requests
8+ conditions :
9+ - -draft
10+ - author~=^dependabot(|-preview)\[bot\]$
11+ - check-success='build (1.14.x, ubuntu-latest)'
12+ - check-success='build (1.15.x, ubuntu-latest)'
13+ - check-success='build (1.16.x, ubuntu-latest)'
14+ - check-success='build (1.14.x, macos-latest)'
15+ - check-success='build (1.15.x, macos-latest)'
16+ - check-success='build (1.16.x, macos-latest)'
17+ - check-success='lint (1.15.x, ubuntu-latest)'
18+ - check-success='lint (1.16.x, ubuntu-latest)'
19+ - check-success='lint (1.15.x, macos-latest)'
20+ - check-success='lint (1.16.x, macos-latest)'
21+ - check-success='Analyze (go)'
22+ - title~=^Bump [^\s]+ from ([\d]+)\..+ to \1\.
23+ actions :
24+ review :
25+ type : APPROVE
26+ message : Automatically approving dependabot pull request
27+ merge :
28+ method : merge
29+ - name : Alert on major version detection
30+ conditions :
31+ - author~=^dependabot(|-preview)\[bot\]$
32+ - check-success='build (1.14.x, ubuntu-latest)'
33+ - check-success='build (1.15.x, ubuntu-latest)'
34+ - check-success='build (1.16.x, ubuntu-latest)'
35+ - check-success='build (1.14.x, macos-latest)'
36+ - check-success='build (1.15.x, macos-latest)'
37+ - check-success='build (1.16.x, macos-latest)'
38+ - check-success='lint (1.15.x, ubuntu-latest)'
39+ - check-success='lint (1.16.x, ubuntu-latest)'
40+ - check-success='lint (1.15.x, macos-latest)'
41+ - check-success='lint (1.16.x, macos-latest)'
42+ - check-success='Analyze (go)'
43+ - -title~=^Bump [^\s]+ from ([\d]+)\..+ to \1\.
44+ actions :
45+ comment :
46+ message : " ⚠️ @theflyingcodr @jadwahab: this is a major version bump and requires your attention"
47+
48+
49+ # ===============================================================================
50+ # AUTOMATIC MERGE (APPROVALS)
51+ # ===============================================================================
52+
53+ - name : Automatic Merge ⬇️ on Approval ✔
54+ conditions :
55+ - " #approved-reviews-by>=1"
56+ - check-success='build (1.14.x, ubuntu-latest)'
57+ - check-success='build (1.15.x, ubuntu-latest)'
58+ - check-success='build (1.16.x, ubuntu-latest)'
59+ - check-success='build (1.14.x, macos-latest)'
60+ - check-success='build (1.15.x, macos-latest)'
61+ - check-success='build (1.16.x, macos-latest)'
62+ - check-success='lint (1.15.x, ubuntu-latest)'
63+ - check-success='lint (1.16.x, ubuntu-latest)'
64+ - check-success='lint (1.15.x, macos-latest)'
65+ - check-success='lint (1.16.x, macos-latest)'
66+ - check-success='Analyze (go)'
67+ - label!=work-in-progress
68+ - -draft
69+ actions :
70+ merge :
71+ method : merge
72+
73+ # ===============================================================================
74+ # AUTHOR
75+ # ===============================================================================
76+
77+ - name : Auto-Assign Author
78+ conditions :
79+ - " #assignee=0"
80+ actions :
81+ assign :
82+ users : [ "@{{author}}" ]
83+
84+ # ===============================================================================
85+ # ALERTS
86+ # ===============================================================================
87+
88+ - name : Notify on merge
89+ conditions :
90+ - merged
91+ - label=automerge
92+ actions :
93+ comment :
94+ message : " ✅ @{{author}}: **{{title}}** has been merged successfully."
95+ - name : Alert on merge conflict
96+ conditions :
97+ - conflict
98+ - label=automerge
99+ actions :
100+ comment :
101+ message : " 🆘 @{{author}}: `{{head}}` has conflicts with `{{base}}` that must be resolved."
102+ label :
103+ add :
104+ - conflict
105+ - name : Alert on tests failure for automerge
106+ conditions :
107+ - label=automerge
108+ - status-failure=commit
109+ actions :
110+ comment :
111+ message : " 🆘 @{{author}}: unable to merge due to CI failure."
112+
113+ - name : remove conflict label if not needed
114+ conditions :
115+ - -conflict
116+ actions :
117+ label :
118+ remove :
119+ - conflict
120+
121+ # ===============================================================================
122+ # LABELS
123+ # ===============================================================================
124+ # Automatically add labels when PRs match certain patterns
125+ #
126+ # NOTE:
127+ # - single quotes for regex to avoid accidental escapes
128+ # - Mergify leverages Python regular expressions to match rules.
129+ #
130+ # Semantic commit messages
131+ # - chore: updating grunt tasks etc.; no production code change
132+ # - docs: changes to the documentation
133+ # - feat: feature or story
134+ # - enhancement: an improvement to an existing feature
135+ # - feat: new feature for the user, not a new feature for build script
136+ # - fix: bug fix for the user, not a fix to a build script
137+ # - idea: general idea or suggestion
138+ # - test: test related changes
139+ # ===============================================================================
140+
141+ - name : Hotfix label
142+ conditions :
143+ - " head~=(?i)^hotfix" # if the PR branch starts with hotfix/
144+ actions :
145+ label :
146+ add : ["hot-fix"]
147+ - name : Bug / Fix label
148+ conditions :
149+ - " head~=(?i)^(bug)?fix" # if the PR branch starts with (bug)?fix/
150+ actions :
151+ label :
152+ add : [ "bug-P3" ]
153+ - name : Documentation label
154+ conditions :
155+ - " head~=(?i)^docs" # if the PR branch starts with docs/
156+ actions :
157+ label :
158+ add : [ "documentation" ]
159+ - name : Feature label
160+ conditions :
161+ - " head~=(?i)^feat(ure)?" # if the PR branch starts with feat(ure)?/
162+ actions :
163+ label :
164+ add : ["feature"]
165+ - name : Enhancement label
166+ conditions :
167+ - " head~=(?i)^enhancement?" # if the PR branch starts with enhancement/
168+ actions :
169+ label :
170+ add : ["feature"]
171+ - name : Chore label
172+ conditions :
173+ - " head~=(?i)^chore" # if the PR branch starts with chore/
174+ actions :
175+ label :
176+ add : ["update"]
177+ - name : Question label
178+ conditions :
179+ - " head~=(?i)^question" # if the PR branch starts with question/
180+ actions :
181+ label :
182+ add : ["question"]
183+ - name : Test label
184+ conditions :
185+ - " head~=(?i)^test" # if the PR branch starts with test/
186+ actions :
187+ label :
188+ add : ["test"]
189+ - name : Idea label
190+ conditions :
191+ - " head~=(?i)^idea" # if the PR branch starts with idea/
192+ actions :
193+ label :
194+ add : ["idea"]
195+
196+ # ===============================================================================
197+ # STALE BRANCHES
198+ # ===============================================================================
199+
200+ - name : Close stale pull request
201+ conditions :
202+ - base=master
203+ - -closed
204+ - updated-at<21 days ago
205+ actions :
206+ close :
207+ message : |
208+ This pull request looks stale. Feel free to reopen it if you think it's a mistake.
209+ # ===============================================================================
210+ # BRANCHES
211+ # ===============================================================================
212+
213+ - name : Delete head branch after merge
214+ conditions :
215+ - merged
216+ actions :
217+ delete_head_branch :
218+
219+ # - name: automatic update for PR marked as “Ready-to-Go“
220+ # conditions:
221+ # - -conflict # skip PRs with conflicts
222+ # - -draft # filter-out GH draft PRs
223+ # - label="Ready-to-Go"
224+ # actions:
225+ # update:
226+
227+ # ===============================================================================
228+ # CONVENTION
229+ # ===============================================================================
230+ # https://www.conventionalcommits.org/en/v1.0.0/
231+ # Premium feature only
232+
233+ # - name: Conventional Commit
234+ # conditions:
235+ # - "title~=^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\\(.+\\))?:"
236+ # actions:
237+ # post_check:
238+ # title: |
239+ # {% if check_succeed %}
240+ # Title follows Conventional Commit
241+ # {% else %}
242+ # Title does not follow Conventional Commit
243+ # {% endif %}
244+ # summary: |
245+ # {% if not check_succeed %}
246+ # Your pull request title must follow [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/).
247+ # {% endif %}
0 commit comments