def check_trigger_rebuild(json):
should_rebuild = False
branch = 'master'
if 'ref' in json and json['ref'] == 'refs/heads/{}'.format(branch):
if 'commits' in json:
commits = json['commits']
for commit in commits:
added = commit['added']
removed = commit['removed']
modified = commit['modified']
for f in added + removed + modified:
prefix, suffix = os.path.splitext(f)
if suffix == '.top':
should_rebuild = True
if json['forced']:
should_rebuild = True
if should_rebuild and test_repo('loving-ai', branch) and update_repo('loving-ai', branch):
threading.Thread(target=rebuild_cs_character, kwargs={'revision': revision, 'botname': BOTNAME}).start()
return True
return False
评论列表
文章目录