Codeigniter: Github api returns empty json

Created on 17 Dec 2014  路  7Comments  路  Source: bcit-ci/CodeIgniter

Hi,

I'm writing a small script that, among other things, downloads latest CI. Usually I use github api to fetch the latest version of any software, but for CI I'm getting empty json response when using GET on https://api.github.com/repos/bcit-ci/CodeIgniter/releases.

I'm not sure if this is a github staff issue or a repo issue, so if you would be so kind to direct me in the right direction. Thanks :)

Most helpful comment

I guess that makes sense, but what I don't understand is why "non-release tags" would show up in /releases via the web interface but not in the API ...

All 7 comments

Can't help you with that, sorry. You should probably ask the GitHub staff about it.

Ok will do ty :)

GH staff response:
" Yeah, the reason why you're seeing an empty array when you fetch the list of releases is that the repository in question doesn't have any "full" releases, it only has Git tags:

https://github.com/bcit-ci/CodeIgniter/releases

The Releases API works only with full releases, which are a GitHub concept (based on Git tags):

https://help.github.com/articles/about-releases

https://developer.github.com/v3/repos/releases/ "

So to be more api friendly, look into it when you fine the time :)

Solution is to use GET /repos/:owner/:repo/tags

Yes, releases and tags are different. Releases are linked to tags, but tags do not need to have releases. Maybe it would be a good idea to add release information for CodeIgniter in GitHub, but in any case, it should be discussed in the forum.

Well, GitHub sure as hell says we have releases and not "just tags": https://github.com/bcit-ci/CodeIgniter/releases

If I understand it correctly, when you go to https://github.com/bcit-ci/CodeIgniter/tags you should see links to the right of each tag which say "Add release notes".

Any tags which have release notes will say "Edit release notes" instead, and will show up as "releases" in the API. For example: https://api.github.com/repos/ci-bonfire/Bonfire/releases shows 3 releases, while https://github.com/ci-bonfire/Bonfire/releases shows the 3 releases (with the latest marked as "Latest release") plus the prior tagged versions.

I guess that makes sense, but what I don't understand is why "non-release tags" would show up in /releases via the web interface but not in the API ...

Was this page helpful?
0 / 5 - 0 ratings