409 error in export_community_engagement when there is an empty repository
AlejandroReBa opened this issue · comments
In this line:
some-github-metrics/github_metrics.py
Line 141 in 195bc61
Next error is thrown when it finds an empty repository. (Catched by main try/catch(except))
409 {"message": "Git Repository is empty.", "documentation_url": "https://docs.github.com/enterprise/2.22/rest/reference/repos#list-commits"}
Can be solved with a nested try/catch to follow up with the next repository.
Moreover,
for commits in repo.get_commits():
countcommit += 1
could be changed by
countcommit = repo.get_commits().totalCount
Implemented in this PR: PyGithub/PyGithub#820
Thanks
Hi Alejandro! I'm sorry for the delay. I just fixed this bug on the PR #16
Let me know if it works. Thanks!
I tried using repo.get_commits().totalCount
but it was still throwing me an error, so I used a basic try and except to check if the repo is empty. Not the BEST solution haha but it works
@gomesfernanda thanks a lot for having a look at the issue 👍🏽
I just passed over it with some quick fixes for a self-demo before leaving the above message; I only wanted to notify you about that because your code was very handy to me.
Regards!