The purpose of this repository is to help enterprise administrators who maintain multiple GHE instances work out unique developers across multiple GHE instances. This script works for both maximum committers and currently consumed GHAS committers.
-
Clone this repository onto your local machine.
git clone https://github.com/advanced-security/ghe-cross-instance-committers.git
-
Change the directory to the repository you have just installed.
cd ghe-cross-instance-committers
-
Copy the
.env.sample
to.env
. On a Mac, this can be done via the following terminal command:cp .env.sample .env
Head to the following URL in each of your GHES instances:
https://${ghes-url}.com/stafftools/ghas_committers
Note If you are struggling to get the file to download because your instance is extremely large, please contact your account team for assistance.
If you are interested in knowing your maximum committer number (e.g. the total number of unique developers across your whole GHE instance), click the download button next to the Total billable committers if GHAS is enabled for all repositories
option.
If you are interested in knowing your current committer number (e.g. the total number of unique developers across your whole GHE instance who are curently consuming a GHAS licence), click the download button next to the Current active committer count
option.
Once that's downloaded, create a new folder and drop the CSV into that folder.
Repeat the steps above across all your GHES instances. Make sure you drop the content into the same folder, you do not need to create a new folder every time.
If you are on a GHEC instance (including EMU), please head to https://github.com/enterprises/${enterprise-slug}/enterprise_licensing
and click "Download CSV" under the Advanced Security section. This will download a CSV, please place that in the same folder as above.
-
Install dependencies
npm install
-
Update the `.env. (Replace the XXX with the relative directory of the csv content you created above)
DIRECTORY_OF_CSV_CONTENT=XXX
-
Run the script
npm run start
The above script should output something like:
You have a total of XX unique developers across your GitHub instances.