# Make sure you authorize your access token to be used with SAML
# https://help.github.com/articles/authorizing-a-personal-access-token-for-use-with-a-saml-single-sign-on-organization/
#
# Run:
# python list_all_repos.py <org>
import github3
import os
GITHUB_ACCESS_TOKEN = os.environ["GITHUB_ACCESS_TOKEN"]
gh = github3.login(token=GITHUB_ACCESS_TOKEN)
org = gh.organization(os.argv[1])
repos = list(org.iter_repos(type="all"))
for r in repos:
print(r)