The current downloads badge for github all releases doesn't account for number of brew installs. For eg. I created a brew tap for my repo and was hoping that the badge would account for those downloads as well but it doesn't.
Further info: Whenever someone brew taps my formula, a shallow clone of the repo is made. Hope that helps !
Hi
You're right that GitHub releases badge only counts downloads of published releases. We report the numbers from the GH API. See: https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository
I don't think the GH API provides a way to count repository clones, but also a repo clone is a different thing from release downloads. For some repos, a release is a source distribution, but if you think about a project like atom which packages binary releases (e.g: https://github.com/atom/atom/releases/tag/v1.28.1 ) a clone of the source code is a different thing to count from a download of a release binary.
I don't really know anything about homebrew because I don't use macs, but it may be possible to (re-)write your brew formula so that it grabs a release tarball instead of cloning your repo. If so I guess that would allow the releases badge to count brew installs.
The clone count does show up in the UI. I wonder if they do expose that number in the API.
Hi every body, they do have a clones count in the API
Clones
On the UI, you can see that value clicking "Insights", then "Traffic"
Is it possible to add this badge?
Thanks!
Thanks for the update. In a similar way to how you can see the number of clones for your own repos, but not other peoples, that endpoint requires an API key with push access to the repo:
$ curl "https://api.github.com/repos/badges/shields/traffic/clones"
{
"message": "Must have push access to repository",
"documentation_url": "https://developer.github.com/v3/repos/traffic/#clones"
}
We wouldn't be able to make use of that endpoint in a secure way on shields.io because the user would have to expose a token allowing an attacker write access to their repo.
So my main idea for this was to see how many people were using the software I made and distributed via homebrew. It was easiest to make a homebrew tap to distribute it on macOS. Now since it was distributed using the homebrew tap and via a curl command etc. I wanted to see the cumulative count of the downloads on it and unfortunately (as far as I looked into it) homebrew doesn't have a method for tracking this (atleast not for taps). So currently I am only able to track the downloads people did using the curl command.
Hope I was able to explain what's going on.
It would be great if someone could figure out a way to do the same since it would be a great contribution not only as a badge but also as an analytic tool for those distributing software via homebrew taps.
Your homebrew formula can download from anywhere. Including a link shortener that tracks clicks. Just think about that for a minute. Then rejoice in what you've learned. Enjoy!
EDIT: Here's an example, although it's highly abstracted. You may still be able to figure it out: https://github.com/golift/application-builder/pull/1
Such a badge (number of github clones) could be updated by using GitHub actions as you can provide a token with enough permissions. 馃 That is some more work than if it could be integrated in shields. I don't understand why this number is not public. 馃槩
Most helpful comment
Hi every body, they do have a clones count in the API
Clones
On the UI, you can see that value clicking "Insights", then "Traffic"
Is it possible to add this badge?
Thanks!