How can I use github api to get all tags or releases for a project?

gamerson picture gamerson · Sep 25, 2013 · Viewed 17.7k times · Source

I would like to know how to use the github-api to get all the current releases or tags for a project. I have seen the documentation for tags in github-api but I don't see a way to list all tags or list all releases but only list a specific tag by :sha.

Answer

user247702 picture user247702 · Sep 25, 2013

It's possible, but the documentation is perhaps not in the place you'd expect it to be.

http://developer.github.com/v3/git/refs/

You can also request a sub-namespace. For example, to get all the tag references, you can call:

GET /repos/:owner/:repo/git/refs/tags