Github API Ability to Limit Clones in Private Repo

I’m interested in creating a Github plugin that allows a repo owner to limit the number of clones allowed in private repos by other members in the repo.

The use case is an employee joins a company and needs to clone the repo once on a company authorized computer. The employee has full push/pull access, but is locked from further clones unless given permission by the repo owner. This would prevent an employee from cloning the repo to other unauthorized devices (i.e. personal computers).

I don’t see anything in the Github API that allows modification of clone permissions. Can anyone shed some light on whether or how this is possible?

:wave: @empireofryan: Welcome to GitHub’s Support Community. We appreciate you asking this question!

I can confirm here that there’s not a single API endpoint nor a setting in our user interface for limiting the number of times a repository can be cloned.

However, we have an Allowed IP Addresses feature for folks on the GitHub Enterprise Cloud plan that may be of interest, based on what I understand of your use case. It’s possible to restrict access to your organization’s assets by configuring a list of IP addresses that are allowed to connect––our team wrote more about this here:

https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/managing-allowed-ip-addresses-for-your-organization

We hope this helps, though we’re keen to hear from others in the community for alternative approaches that we haven’t considered! :sparkles: