Skip to content

Commit 9e906cf

Browse files
Mergeable Integration (segmentio#546)
1 parent 10ae37c commit 9e906cf

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/mergeable.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
version: 2
2+
mergeable:
3+
- when: pull_request.*, pull_request_review.*
4+
name: Change Control Pre-Merge-Check
5+
validate:
6+
- do: or
7+
validate:
8+
- do: and
9+
validate:
10+
- do: approvals
11+
min:
12+
count: 1
13+
- do: description
14+
or:
15+
- and:
16+
- must_exclude:
17+
regex: Testing completed successfully
18+
- must_include:
19+
regex: Testing not required
20+
- and:
21+
- must_include:
22+
regex: Testing completed successfully
23+
- must_exclude:
24+
regex: Testing not required
25+
- must_include:
26+
regex: 'CC-\d{4,5}'
27+
- do: title
28+
must_include:
29+
regex: stage|staging|README|non-prod|docs
30+
pass:
31+
- do: checks
32+
status: success
33+
payload:
34+
title: Mergeable Run has been Completed!
35+
summary: All the validators are passing!
36+
fail:
37+
- do: checks
38+
status: failure
39+
payload:
40+
title: Mergeable Run has been Completed!
41+
summary: "### Status: {{toUpperCase validationStatus}}\
42+
\nHere are some stats of the run:\
43+
\n{{#with validationSuites.[0]}} {{ validations.length }} validations were ran. {{/with}}\n"
44+
text: "{{#each validationSuites}}\n
45+
### {{{statusIcon status}}} Change-Control Pre-Merge Check \n
46+
#### All PRs must follow bellow Change-Control rules: \n
47+
* ##### {{#with validations.[0]}} {{{statusIcon status}}} Must have at least one approval.\n {{/with}}
48+
* ##### {{#with validations.[1]}} {{{statusIcon status}}} Description includes a testing plan: \n
49+
\t ##### \"Testing not required\" OR \"Testing completed successfully\" but NOT BOTH. \n
50+
\t ##### OR \n
51+
\t ##### Jira Change-Control ticket is included.\n {{/with}}\n\n
52+
#### PRs that are exempt from Change-Control: \n
53+
* ##### {{#with validations.[2]}} {{{statusIcon status}}} Title includes stage, staging, README, non-prod, docs.\n {{/with}}\n
54+
{{/each}}"

0 commit comments

Comments
 (0)