A Node.js-based tool to track and analyze GitHub pull requests for specified users. This tool is particularly useful for monitoring contributions and generating reports about PR activity.
- Fetch all pull requests for specified GitHub users
- Track PR status (open, closed, merged)
- Generate detailed CSV reports
- Summarize PR statistics by user and organization
- Support for authentication using GitHub Personal Access Token
- Node.js (Latest LTS version recommended)
- npm (comes with Node.js)
- GitHub Personal Access Token (optional, but recommended for higher rate limits)
-
Clone this repository
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory and add your GitHub token (optional):GITHUB_TOKEN=your_github_token_here
fetch-prs.cjs
- Main script to fetch pull requests for specified userscount-prs.cjs
- Script to generate PR statistics and summariesdata/
- Directory containing input files and generated reportsusernames-gsoc.txt
- Input file containing GitHub usernames to track- Output files will be generated here
-
Add GitHub usernames to track in
data/usernames-gsoc.txt
(one username per line) -
Run the fetch script:
node fetch-prs.cjs
This will generate a CSV file in the data
directory with details of all pull requests.
To generate a summary of PR statistics:
node count-prs.cjs
This will create a summary CSV file with PR counts by user and organization.
- username
- org/user
- repo
- PR link
- PR status
- PR merged
- PR date
- username
- org
- open PRs
- merged PRs
- closed PRs
- total PRs
- axios: For making HTTP requests to GitHub API
- csv-parser: For processing CSV files
- dotenv: For managing environment variables
- The GitHub API has rate limits. Using a Personal Access Token is recommended for higher limits.
- The tool respects GitHub's API rate limits and includes error handling.
- Large numbers of users or PRs may take longer to process due to API pagination.
This project is open source and available under the MIT License.