This repository was archived by the owner on Jun 16, 2021. It is now read-only.
Commit 5523f16 1 parent d1aeda7 commit 5523f16 Copy full SHA for 5523f16
File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 60
60
'renovate' ,
61
61
}
62
62
63
+ IGNORED_NICK_PARTS = {
64
+ '[bot]' ,
65
+ }
66
+
63
67
app = Flask (__name__ )
64
68
bot_global = None
65
69
flask_started = False
@@ -168,6 +172,9 @@ def handle_push_event(data):
168
172
return
169
173
# Filter bad words
170
174
for commit in data ['commits' ]:
175
+ for k in IGNORED_NICK_PARTS :
176
+ if k in commit ['author' ]['name' ]:
177
+ return
171
178
for k in IGNORED_KEYWORDS :
172
179
if k in commit ['message' ]:
173
180
return
@@ -220,6 +227,10 @@ def handle_unimplemented_event(data, event):
220
227
221
228
222
229
def handle_create_event (data ):
230
+ # Filter bad words
231
+ for k in IGNORED_NICK_PARTS :
232
+ if k in data ['sender' ]['login' ]:
233
+ return
223
234
ref_type = data ['ref_type' ]
224
235
if ref_type == 'branch' :
225
236
bot_say ("{} Branch {}{}{}/{} created by {}" .format (COLOR_PREFIX ,
@@ -259,7 +270,7 @@ def handle_delete_event(data):
259
270
260
271
def handle_pull_request_event (data ):
261
272
# Filter bad words
262
- for k in IGNORED_KEYWORDS :
273
+ for k in IGNORED_NICK_PARTS :
263
274
if k in data ['pull_request' ]['user' ]['login' ]:
264
275
return
265
276
url = github_shortify (data ['pull_request' ]['html_url' ])
You can’t perform that action at this time.
0 commit comments