A Python utility for analyzing GitHub Advanced Security (GHAS) license usage and requirements across GitHub Enterprise organizations and repositories.
This tool helps GitHub Enterprise administrators analyze their GHAS license utilization by:
- Fetching active committers from repositories within specified organizations
- Comparing these committers against existing GHAS license allocations
- Identifying committers who are not currently covered by GHAS licenses
- Generating comprehensive reports in both Markdown and CSV formats
- Analyzes GHAS license allocation and usage
- Identifies active repository committers from the last 90 days
- Compares existing GHAS license holders against active committers
- Identifies users who need GHAS licenses but don't have them
- Supports individual repositories or entire organizations
- Generates detailed reports in multiple formats
python analysis.py --token YOUR_PAT --enterprise ENTERPRISE_NAME [OPTIONS]--token/-t: GitHub Personal Access Token with appropriate permissions--enterprise/-e: GitHub Enterprise name (required for GHAS analysis)
--csv/-c: Path to CSV file containing organizations (format: org)--orgs/-g: List of organizations to analyze (space-separated)--output/-o: Output file path (default: github_analysis_report.md)--enterprise_server_hostname/-H: GitHub Enterprise Server hostname--debug/-d: Enable debug logging
The script generates several reports in a dedicated reports folder:
- Markdown summary report
- CSV list of GHAS-licensed committers
- CSV list of committers without GHAS licenses
- Repository analysis with committer details
- Repository summary with committer counts
python analysis.py -t ghp_YOUR_TOKEN -e your-enterprise -g org1 org2 org3- Python 3.6+
- Required packages:
- requests
- argparse
- csv