-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.mr-linter.yml
124 lines (106 loc) · 2.68 KB
/
.mr-linter.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
rules:
"@mr-linter/has_any_labels":
labels:
- Feature
- Bug
- Docs
- Tests
- Optimization
"@mr-linter/description_template":
- definition: description must have list of features
template: |
## Added
{text_multiline}
when:
labels:
has: "Feature"
- definition: description must have list of fixed bugs
template: |
## Fixed
{text_multiline}
when:
labels:
has: "Bug"
"@mr-linter/title_must_starts_with_any_prefix":
prefixes:
- '[Feature]'
- '[Bug]'
- '[Docs]'
- '[Tests]'
- '[Optimization]'
"@mr-linter/description_not_empty": {}
"@mr-linter/changelog_has_new_release":
when:
targetBranch:
equals: "master"
title:
notStartsAny:
- '[Tests]'
- '[Docs]'
"@mr-linter/no_ssh_keys":
stopOnFirstFailure: true
critical: false
"@mr-linter/has_changes":
- changes:
- file: "src/Version.php"
updatedPhpConstant: "VERSION"
when:
targetBranch:
equals: "master"
title:
notStartsAny:
- '[Tests]'
- '[Docs]'
"@mr-linter/disable_file_extensions":
extensions:
- pem
- pub
custom:
- definition: "Branch must be in kebab-case"
rules:
sourceBranch:
isKebabCase: true
- definition: "Split feature / bug PR"
rules:
labels:
notIntersect:
- Feature
- Bug
notifications:
channels:
dev:
type: 'telegram_bot'
chat_id: 'env(MR_LINTER_TELEGRAM_CHAT_ID)'
bot_token: 'env(MR_LINTER_TELEGRAM_BOT_TOKEN)'
sound_at: '09:00-21:00'
on:
lint_finished:
channel: 'dev'
template: |
👀 Review on PR "{{ request.title | raw }}" by {{ request.author.login }} at {{ request.createdAt.format('Y-m-d H:i') }}
🌲 {{ request.sourceBranch }} ➡ {{ request.targetBranch }}
🌐 {{ request.uri }}
📉 Notes: {{ result.notes.count }}
{% for note in result.notes %}
- {{ note.description | raw }}
{% endfor %}
ci:
github_actions:
credentials:
token: 'env(MR_LINTER_GITHUB_HTTP_TOKEN)'
comments:
strategy: 'single'
messages:
- template: |
I found {{ result.notes.count }} notes in your Pull Request:
{% for note in result.notes %}
- {{ note.description | raw }}
{% endfor %}
when:
result.notes:
isEmpty: false
- template: |
I didn't find any notes in your Pull Request.
when:
result.notes:
isEmpty: true