OrgRepoScanner is a Python tool for scanning all organizations in a GitHub Enterprise instance and exporting repository data to CSV files.
It uses the GitHub REST API and a Personal Access Token (PAT) for authentication.
The scanner collects information about repositories, including whether they are archived, use Git LFS, or have webhooks.
- Scans all organizations the authenticated user is a member of
- Lists all repositories in each organization
- Detects archived repositories
- Checks for Git LFS usage (
.gitattributeswithfilter=lfs) - Checks for webhooks
- Outputs summary and detailed CSV reports
- Parallel scanning for speed
- Python 3.8+
- requests
- python-dotenv
- tqdm
Install dependencies:
pip install requests python-dotenv tqdmCreate a .env file in the project root with the following variables:
# GitHub Enterprise Server URL
source_Git=https://git.autodesk.com
# Personal Access Token (PAT) with read:org and repo scopes
GH_SOURCE_PAT=your_personal_access_token
# Enterprise name (slug)
SOURCE_ENT_NAME=autodesk-inc
# Optional: Logging and output settings
LOG_LEVEL=INFO
OUTPUT_FORMAT=csvRun the scanner:
python export_org_repos.pyOutput files will be created in the current directory:
enterprise_orgs_summary_<date>.csventerprise_repos_detailed_<date>.csventerprise_webhooks_<date>.csv(if webhooks found)enterprise_lfs_<date>.csv(if LFS found)
- Authenticates to GitHub Enterprise using your PAT.
- Discovers organizations you are a member of.
- Scans each organization for repositories.
- For each repository, checks if it is archived, uses LFS, or has webhooks.
- Writes results to CSV files and prints a summary.
- Make sure your PAT has the required scopes (
read:org,repo). - Ensure your base URL and enterprise name are correct.
- If you see errors accessing organizations or repositories, check your permissions and org membership.
MIT License
- Autodesk Engineering Tools