This script enumerates active committers in specified GitHub repositories over a given number of days. It fetches the data using the GitHub API and outputs the results to CSV files.
The objective behind this project was to facilitate the survey of the real number of users who collaborate in the Github repositories of important company projects, and thus be able to price SAST and SCA licenses with greater accuracy.
- Michelle Mesquita - https://github.com/michelleamesquita
- Murillo Rocha - https://github.com/6drocha
- Tiago "Kid" Machado - https://github.com/gar0t0
- Fetch active committers from specified GitHub repositories.
- Retrieve commit data from the main branch within a specified number of days.
- Output results to CSV files, including detailed commit counts per user.
- Python 3.x
requests
librarypyyaml
librarytermcolor
libraryemoji
library
- Clone the repository or download the script files.
- Install the required Python libraries:
pip install -r requirements.txt
-
Create a
config.yaml
file with the following content and replaceyour_github_token
with your GitHub personal access token:github_token: "your_github_token"
-
Create a
repositories.txt
file and add the repositories you want to analyze, one per line, in the formatowner/repo
orhttps://github.com/owner/repo
.
Run the script with the desired number of days to check for active committers using the -d
flag:
python gh_committers_spy.py -d 90
Receiving the number of collaborators in default branch in the last 90 days.
- Ensure you have a valid GitHub personal access token with appropriate permissions to access the repositories.
- The script checks commits on the default branch of each repository.
- If a repository URL is provided, it will be converted to the format owner/repo.
- GitHub REST API v3
- Requests: HTTP for Humans
- PyYAML Documentation
- Checkmarx One Cloud Licence Types and Restrictions
- Veracode - Understanding the license consumption reports
☕ If this tool helped you, how about inviting me for a coffee?? 😄