This script generates csv files with the following information about pull requests in a GitHub repository:
- Name of repository
- PR Number
- PR Title
- PR State
- PR User
- PR Created At
- PR Updated At
- PR Closed At
- PR Merged At
- Python 3.6 or higher
- GitHub Personal Access Token
- "Metadata" repository permissions (read)
- "Pull requests" repository permissions (read)
pip install -r requirements.txt
For all repositories in an organization
python pr.py -o <organization> -t <github_token>
For only one repository
python pr.py -o <organization> -r <repository> -t <github_token>
https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests https://docs.github.com/en/enterprise-cloud@latest/rest/repos/repos?apiVersion=2022-11-28
- CSV Sample (Microsoft/VSCode) : https://github.com/junkofujiwara/pr-analysis/blob/main/samples/vscode.csv
- Tableau Dashboard Sample: https://public.tableau.com/app/profile/junko.fujiwara.gh/viz/GitHubPullRequestAnalaysis/Dashboard