示例#1
0
def github_urls():
    repoRelaseMapping = distro.getRepoReleaseMapping()
    urls={}
    for repo in repoRelaseMapping.keys():
        release = repoRelaseMapping[repo]
        url='https://github.com/nasifimtiazohi/{}-{}'.format(repo,release)
        urls[common.getRepoId(repo)]=url
    return urls
def deleteRepo(name):
    g = Github(token)
    user = g.get_user()
    repo = user.get_repo(name)
    repo.delete()


def enableSecurityFixes(name):
    g = Github(token)
    user = g.get_user()
    repo = user.get_repo(name)
    repo.enable_automated_security_fixes()


if __name__ == '__main__':
    repoRelaseMapping = distro.getRepoReleaseMapping()
    paths = common.getAllRepos()
    dest = '/Users/nasifimtiaz/Desktop/openmrsCopyRepos/'

    for path in paths:
        repo = path.split('/')[-1]
        release = repoRelaseMapping[repo]
        githubReponame = repo + '-' + release
        print(githubReponame)
        enableSecurityFixes(githubReponame)

        #resetAndCheckHead(path, release)
        # copyFilesOfGitRepo(path, dest)
        # createGithubRepo(githubReponame)
        # repositorySetup(dest+repo+'/', githubReponame)
        # enable_dependency_alerts('nasifimtiazohi',githubReponame)