I am experiencing problems with the Github API when I try to get the releases for a public repo. I've made several request to /repos/:owner/:repo/releases (https://developer.github.com/v3/repos/releases/#list-releases-for-a-repository) and I'm not able to obtain the releases of a repo, except when I request for the releases of one of my repos and I had created the releases via Github API (https://developer.github.com/v3/repos/releases/#create-a-release).
For example, this GET request to the server returns an empty body and a 200 status:
https://api.github.com/repos/jquery/jquery/releases
I make the request with the Authorization header (Authorization: token {MY_TOKEN}), specifying a token mine with gist, repo and user permisions.
Can you tell me if I'm doing something wrong or what is the best approach to retrieve the releases of a repo?
Thanks!
Hitting https://api.github.com/users/USERNAME/repos will list public repositories for the user USERNAME.
Viewing releases On GitHub.com, navigate to the main page of the repository. To the right of the list of files, click Releases. At the top of the Releases page, click Releases.
You cannot request non-published releases. So if the request come with an empty response body then there is no published release under that repository i.e. github.com/jquery/jquery don't have one.
In order to get a JSON feed containing a list of a (owner/repo) releases using the Github Release API endpoint "/repos/:owner/:repo/releases" there must be published releases in that repo.
This is how a published release looks like:
And here you can try to request a release on a repo of mine where I already published a release version: https://api.github.com/repos/wisebrains/wise-archetypes/releases
In many cases there are no published releases, but you can still list tags by using GET /repos/:owner/:repo/tags
endpoint.
For example:
GET https://api.github.com/repos/twigphp/twig/tags
Note that this call will only return the 30 latest tags.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With