-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rulesrc
122 lines (116 loc) · 3.59 KB
/
.rulesrc
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
--- # Rules config file
options:
executeAllRules: true
enableRules: true
enableGroups: false
allRuleResultInOne: false
rules:
# BRANCH
- name: branchName
options:
regexp: '^(fix|feature)/.*'
onError:
- callback: LoggerRunnable
args:
message: 'Branch {{data.branchName}} does not begin with fix or feature.'
onSuccess:
- callback: CreatePullRequestRunnable
args:
title: 'WIP: {{data.branchName}}'
description: 'Work in Progress Pull Request'
draft: true
# PULL REQUESTS
- name: pullRequestTitle
options:
regexp: '^(WIP|FIX):\s.*'
onError:
- callback: CommentPullRequestRunnable
args:
comment: 'ping @bastienterrier'
- name: checkPullRequestStatus
options:
status: reopened
onSuccess:
- callback: SendEmailRunnable
args:
subject: 'Pull Request #{{data.pullRequestNumber}} reopened '
message: '<b>{{data.pullRequestTitle}}</b> has been reopened, please pay attention!'
- name: pullRequestComment
options:
regexp: '^ping @bastienterrier$'
onSuccess:
- callback: LoggerRunnable
args:
type: warn
message: 'Someone ping you!'
# COMMITS
- name: commitMessage
options:
regexp: '^(build|ci|docs|feat|fix|perf|refactor|style|test|release)(\([a-z-$]*\))?:\s(.*?)(\(#[1-9][0-9]*(?:, #[1-9][0-9]*)*\))?$'
maxLength: 50
branches:
ignore:
- gh-pages
onSuccess:
- callback : WebhookRunnable
args:
url: 'https://webhook.site/d98e65d2-630d-45a1-896d-7ba5047b0dc4'
data: {
user: 'bot',
content: '{{#data.commits}}{{sha}} =
Object: {{matches.[1]}} | Scope: {{matches.[2]}} | Issue: {{matches.[3]}}
{{/data.commits}}'
}
onError:
- callback: LoggerRunnable
args:
message: 'Caution, commit(s): {{#data.commits}}{{message}}{{sha}},{{/data.commits}} do not respect Good Practices!'
onBoth:
- callback: UpdateCommitStatusRunnable
args:
failTargetUrl: 'https://gist.github.com/stephenparish/9941e89d80e2bc58a153#examples'
successTargetUrl: 'https://gist.github.com/stephenparish/9941e89d80e2bc58a153#examples'
successDescriptionMessage: 'Commit message matches the Good Practices!'
failDescriptionMessage: 'Caution, your commit message do not matches the Good Practices!'
- name: commitMessage
options:
regexp: '#deploy'
onSuccess:
- callback : DeployFolderRunnable
args:
folder: docs
branch: gh-pages
- name: commitMessage
options:
regexp: '#(v.*)#'
onSuccess:
- callback : CreateTagRunnable
args:
tag: '{{data.commits.[0].matches.[1]}}'
message: 'new version !'
- name: checkAddedFiles
options:
regexp: '.*\.exe$'
onSuccess:
- callback: DeleteFilesRunnable
args:
message: 'removing .exe file'
#ISSUES
- name: issueTitle
options:
regexp: '(fix|Fix)\s.*'
onSuccess:
- callback: SendEmailRunnable
args:
subject: 'New issue: "{{data.issue.title}}" (#{{data.issue.number}})'
message: '<b>{{data.issue.title}}</b> has been created!<br>{{data.issue.description}}'
- name: issueComment
options:
regexp: '^ping @bastienterrier$'
onSuccess:
- callback: LoggerRunnable
args:
type: warn
message: 'Someone ping you!'