Last active
May 30, 2023 14:27
-
-
Save gp42/5e7364bcc74fe8402e9dc33074eb53d3 to your computer and use it in GitHub Desktop.
List all repositories in a GitHub Organization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List all repositories in GitHub Organization | |
# | |
# GIT_ORG - Organization name | |
# GIT_TOKEN - GitHub access token | |
# | |
import os | |
# pip install pygithub | |
from github import Github | |
org = os.environ['GIT_ORG'] | |
git_token = os.environ['GIT_TOKEN'] | |
g = Github(git_token) | |
for repo in g.get_organization(org).get_repos(sort='full_name'): | |
print(f'{repo.name},{repo.archived}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment