A Go CLI tool to analyze GitHub repositories in an organization.
Set the GITHUB_TOKEN environment variable with a personal access token that has access to the organization.
Run the CLI:
cd src
go run main.go -org <organization-name> [-repo <repository-name>]Or build and run:
make build
./trash-panda-cli -org <organization-name> [-repo <repository-name>]The -repo flag is optional. If provided, only the specified repository will be analyzed (if it's not archived). Otherwise, all non-archived repositories in the organization will be processed.
The tool will first display all teams in the organization, then list all repositories and for each repo, display:
- Total number of commits
- Last commit datetime
- Whether it has a CODEOWNERS file (checked in root and .github/ directories)
- Assigned teams (list of team names)
- CODEOWNERS teams (list of teams referenced in the file)
- Whether the CODEOWNERS file contains valid teams (existing in GitHub and assigned to the repo)
- Whether there are branch protection rules on the main branch