gh.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:loving-ai 作者: opencog 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号