Pergunta

I'm working on an app that creates private Github repositories (among other things). Every once in a while, we are over quota with our private repos.

I'd like to know how many repositories we have left before making the API call that will fail.

Can that be done, using the Github API? I couldn't find anything in the documentation, but that's doesn't mean it's not possible :)

Foi útil?

Solução

awendt, I'm not quite familiar with private quotas, but authenticated users receive a Plan object when the API returns the call to /user. This will tell you what plan you have and will tell you how many private_repos you're allowed. With that information and the information from /user which tells you how many private repos you currently have, you should be able to figure it out.

Then again, you could use github3.py and you'd have the User object, with the plan attribute and could use those two together as described above.

Disclaimer I'm github3.py's author.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top