Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
/ github-stats Public archive

Small Node CLI tool to extract active contributors on repos and orgs

License

Notifications You must be signed in to change notification settings

aarlaud-snyk/github-stats

Repository files navigation

Github list and stats extractor (both Github.com and Github Enterprise)

Simple CLI node app to extract details about github organization and repositories

Known Vulnerabilities CircleCI

Packages: Node JS CLI app using commander, chalk, and github-base

Installation

  1. git clone https://github.com/aarlaud-snyk/github-stats
  2. npm install

Prerequisites

Usage

  • node index.js repoList <Org name> -t <GitHubToken>
  • node index.js repoContributorCount <Org name> <Repo Name> -t <GitHubToken>
  • node index.js orgContributorCount <Org name> -t <GitHubToken>

Example: node index.js orgContributorCount snyk -t <my_github_token>

Useful flags

  • Use -p or --private to restrict to private repos only (repoList and orgContributorCount only)
  • use --apiurl to set the url of your Github Enterprise instance API Endpoint (i.e --apiurl=https://my-ghe-instance.company.com/api/v3)
  • if using proxy, exporting the http_proxy settings should do the trick. Google search the details of how to set that up, pretty straightforward.

You might need multiple runs to get the results.Github does not return results immediately. So it is very likely not to return any results at first. Try again after a short moment. If you have a lot of repos in the organization, you might need to run it multiple times until the total number is extracted (details about Github's word about caching)

Commands

  • repoList: List all repositories under an organization. Can filter on private repos only (--private).
  • repoContributorCount: List the number of active contributors for a specific repositories
  • orgContributorCount: List the number of active contributors for an entire organization.. Can filter on private repos only (--private).
An active contributor to a repo is someone who has committed code at least once in the last 90 days.

Untested

  1. username and password attempts, mainly because I have 2FA enabled so need a token. Do yourself a favor, please enable 2FA regardless

About

Small Node CLI tool to extract active contributors on repos and orgs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published