This python script aims to provide a tool to iterate effectively over multiple Github repositories. This utilises the Github API and loops over these calls building up the responses.
The initial intent of this repo was to extract our organisations (KoodooHQ) Github issues for migration onto Jira. It can be expanded to do whatever Github repo magic you desire.
We're making this avaliable because all other tools we found were rather duff! (just remember us for any mortgage-based FinTech you need)
It can currently:
- Find all repositories a single user has access to (inc filtering - useful for personal or organisation repositories)
- Extract all issues from all found repositories and store them in a CSV
1 - Make sure you have python 3 installed locally
2 - Obtain a Personal Access Token from Github with the required permissions (see Gotchas)
3 - Provide the required parameters either as input arguments or environment variables (if applicable)
I use this tool by initially setting GITHUB_TOKEN to the string I obtained like this:
export GITHUB_TOKEN=super-duper-important-string
Call the tool:
python github-issues-exporter.py -f KoodooHQ
It'll then tick through, telling you where it's up to:
Afterwards you'll see an issues.csv in the root directory!
Go nuts with whatever filters you desire and by all means play around with the source code, just don't forget to share, we'd love to see where this goes (hopefully futher than the Github API).
Make sure you have the right access token! This has been tested with a Personal Access Token with all the repo permissions:
- repo:status
- repo_deployment
- public_repo
- repo:invite
- security_events
The most common error encountered is due to using this tool with a token without sufficient permissions.
