How can I find which user created a repository?

I manage a large organization in github, and I’m trying to find who created who created a repository.

I don’t see an obvious way to find this via the API.

I can see in the audit logs when a certain user created a repo using this event:


However, the audit log isn’t accessible via the API and only kept 90 days long.

Is there a reasonable way to find who created which repository in the last two years?

Can you please add the user name of the user who created the repository to information retrieved via the

api under the repo list? Or at least give us a way to access the audit log.

Hi @oz123,

Thanks for being here! You are correct If the repository is less than 90 days old and has less than 300 repository events, it’s possible to retrieve the original CreateEvent for the repository creation, where the ref_type is `repository, via the List repository events API endpoint.

After 90 days or 300 repository events, it is no longer possible to retrieve this initial event via the API, and you must use the GitHub Enterprise audit log.

I hope this helps, please let us know if you have any other questions.

I’ll just add, at Microsoft, we had this challenge for a long time, too… here’s what we essentially do now:

  • we have org-wide web hooks for all of our orgs that are processed centrally, so we can maintain our own audit log, even for accounts that are not Enterprise Cloud… storing in a DB the username of who created the repo
  • we backfilled the data using the exported JSON audit log (entire history of the orgs) when we launched the feature, so we have past repo creators outside of a few edge cases

And for our largest orgs, we actually to not grant our members repo create privs, and instead require them to go through a separate ‘new repo wizard’ portal where we get even more data - what the project is, why, etc. - and that way we store in our own records even more context about their repo intent.

Hope this helps.