vbrandl / hoc

Generate Hits-of-Code badges for GitHub repositories

Home Page:https://hitsofcode.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generate badges for private repositories

ChameleonTartu opened this issue · comments

commented

It's not possible to generate HOC badge for private repositories.
It would be nice to generate independently of publicity.

To clone a private repo, you need git credentials of a user with read access to the repo.
So I would need some kind of user management, which would complicate things a lot. I will look into that later but I'm not sure if I will implement something like this in the foreseeable future.

I think it is possible to clone private repos like this: git clone https://<token>@github.com/owner/repo.git

If you are OK with including the badge in your readme like https://hitsofcode.com/github/user/repo?token=<token> where token is a read only access token for your repo, this might be a solution.

Anyone who is able to access your repo can see that token but it won't give them any more permissions than they already have. Only when revoking read access for a user, you'd have to revoke the access token, too, to be sure.

Would this concept work for you?

Closed due to inactivity

@vbrandl Sorry for revisiting an old thread.

It would be awesome if you included this feature. I have been working on the tweaks, but I need more experience with rust.

I would look into it, but I'm short on ideas... I don't want to implement full blown user management to keep the application simple. On the other hand, I don't want to send access tokens via GET requests.

Do you have any ideas, how this could be implemented?

I'm still reviewing the code. Let me think of an approach. I'll get back to you shortly.