-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.yaml
146 lines (131 loc) · 4.96 KB
/
test.yaml
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
# Generic actions definitions
################################################################################
# Check action used to overwrites mergeable default messages in case of errors
# additionally certain rules customize the pass action so other
# actions should be customized too so there is always feedback to GitHub.
.check-error-action: &check-error-action
do: checks
status: "action_required"
payload:
title: "Mergeable configuration errors!"
summary: |
### Status: {{toUpperCase validationStatus}}
Some or All of the validators have returned 'error' status,
please check below for details
Here are some stats of the run: \n
{{validationCount}} validations were ran.
{{passCount}} PASSED
{{failCount}} FAILED
{{errorCount}} ERRORED
text: "{{#each validationSuites}}
#### {{{statusIcon status}}} Validator: {{toUpperCase name}}
Status {{toUpperCase status}}
{{#each validations }} * {{{statusIcon status}}}\
{{{ description }}}\n
{{#if details.error}}
Error : {{{details.error}}}
{{/if}}
{{/each}}
{{/each}}"
# Check action used to overwrites mergeable default messages in case of failure
# (validations did not passed e.g. approval not given)
# additionally certain rules customize the pass action so other
# actions should be customized too so there is always feedback to GitHub.
.check-failure-action: &check-failure-action
do: checks
status: "failure"
payload:
title: "Approval needed"
summary: |
### Status: {{toUpperCase validationStatus}}
Here are some stats of the run:
{{validationCount}} validations were ran.
{{passCount}} PASSED
{{failCount}} FAILED
text: "{{#each validationSuites}}\n
#### {{{statusIcon status}}} Validator: {{toUpperCase name}}\n
{{#each validations }} * {{{statusIcon status}}}\
{{{ description }}}\n
{{/each}}\n
{{/each}}"
# Check action used to overwrites mergeable default messages in case of success
# (validations passed e.g. approval given or not needed)
# additionally certain rules customize the pass action so other
# actions should be customized too so there is always feedback to GitHub.
.check-success-action: &check-success-action
do: checks
status: "success"
payload:
title: "Approval given or not needed"
summary: |
### Status: {{toUpperCase validationStatus}}
Here are some stats of the run:
{{validationCount}} validations were ran.
{{passCount}} PASSED
{{failCount}} FAILED
text: "{{#each validationSuites}}\n
#### {{{statusIcon status}}} Validator: {{toUpperCase name}}\n
{{#each validations }} * {{{statusIcon status}}}\
{{{ description }}}\n
{{/each}}\n
{{/each}}"
# PR: title validation rule
#
# Check if title follows the "<component>: <short description>" syntax
#
# Needed when:
# * always
#
.pr-title-validator-component-description: &pr-title-validator-component-description
do: title
or:
- begins_with:
match:
- 'Revert'
- 'revert'
- 'Merge'
- 'merge'
- 'Bumped Submodules'
- 'Bumped submodules'
- 'bumped submodules'
message: >-
Title field in PR does not start with Revert, Merge, Bumped Submodules.
# search for "<component>: <short description>" regex using "^\S+: .+$"
- must_include:
regex: '^\S+: .+$'
message: >-
Title field in PR is incorrect.
Check
[documentation](https://cc-github.bmwgroup.net/pages/node0/node0-linux-documentation/master/contributing-information/pr-commit-conventions.html)
for details.
.pr-title-validation-check: &pr-title-validation-check
when: pull_request.edited, pull_request.opened, pull_request.ready_for_review, pull_request.reopened, pull_request.synchronize, pull_request.unlabeled, pull_request_review.edited, pull_request_review.submitted
name: "PR: title validation"
validate:
- *pr-title-validator-component-description
pass:
- *check-success-action
fail:
- *check-failure-action
error:
- *check-error-action
# Repositories definitions
# Combines a repository filter with generic rules definition
# so they can then be listed in the final config
################################################################################
# Repo: mergeable-test
.mergeable-test-filter: &mergeable-test-filter
do: repository
name:
must_include:
regex: "^mergeable-test$"
.mergeable-test-pr-title-validation-check: &mergeable-test-pr-title-validation-check
<<: *pr-title-validation-check
filter:
- *mergeable-test-filter
################################################################################
# Mergeable configuration
################################################################################
version: 2
mergeable:
- *mergeable-test-pr-title-validation-check