GitHub Enterprise server can generate a CSV of all repositories, but it is missing the topics of those repos. This tool helps with that.
The All Repositories report is a CSV like this
created_at,owner_id,owner_type,owner_name,id,name,visibility,readable_size,raw_size,collaborators,fork?,deleted?
2023-02-01 15:48:05 +0000,5,Organization,Org1,5,repo5,private,0 Bytes,0,0,false,false
but what if you want the topics as well for each of those repos?
created_at,owner_id,owner_type,owner_name,id,name,visibility,readable_size,raw_size,collaborators,fork?,deleted?,topics
2023-02-01 15:49:55 +0000,5,Organization,Org1,5,repo5,private,0 Bytes,0,0,false,false,"classified,duplicate,emea,support"
npm install
Goto your user settings
Open Developer settings at the bottom of the blade
Then Personal access tokens
Generate a new token with the following permission
Then use the domain of your GHES (yeah I know badly named, I would love to review a pull request to fix this) to put into the GHES_URL And use the PAT (Personal access token) as the GHES_TOKEN. For reference the commands look a bit like this, but remember to change the values.
export GHES_URL="sams-test-ghes.deneb.com"
export GHES_TOKEN="gh_tokengoeshere"
This is generated in Stafftools on GitHub Enterprise server and looks something like this -
Copy the all-repositories report into the root of this repo and run the node app
node index.js all-repositories-reportnumber.csv all-repositories-with-topics.csv