def update_organisation_repos(organisation, token, filename, excludes, include_forks):
"""Searches a Github organisation for repositories that can be
cloned, writes discovered repo URLs to a local file."""
github_client = Github(token)
org = github_client.get_organization(organisation)
printerr("Looking up {org} repositories (may take some time)".format(org=organisation))
repos = org.get_repos("public")
if not include_forks:
repos = (repo for repo in repos if not repo.fork)
clone_urls = _clone_urls(repos)
filtered = filter_excluded_repos(clone_urls, excludes)
with open(filename, "w") as f:
_write_repo_list(filtered, f)
printerr("Wrote list of repositories to {location}".format(location=filename))
return
评论列表
文章目录