def check_for_auto_merge_trigger(text):
"""Checks the text for the phrases that should trigger an automerge."""
# The comment must address @dpebot directly, on the same line
comment = re.search(
r'@{}\s+\b(.+)'.format(github_helper.github_user()), text, re.I)
if not comment:
return False
else:
# Just get the meat of the command
comment = comment.group(1).strip()
satisfaction = r'\b(pass|passes|green|approv(al|es)|happy|satisfied)'
ci_tool = r'\b(travis|tests|statuses)\b'
merge_action = r'\bmerge\b'
triggers = (
r'{}.+({}.+)?{}'.format(merge_action, ci_tool, satisfaction),
r'{}.+{},.+{}'.format(ci_tool, satisfaction, merge_action),
'lgtm',
)
return any(re.search(trigger, comment, re.I) for trigger in triggers)
webhooks.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录