Git Command Line Snippets: Get Release Information

GitHubThis post is part of the series on Git Command Line Snippets where I am taking a look at performing actions on GitHub using the git command line.

In the last post, of this series, I covered the command to create a release and mentioned that uploading a release zip (extra asset) had to be handled separately. While the command to do this isn’t too complex, there is one problem; to upload the asset you need the tag d of the release. This is not the tag that you supply to create the release with, but the internal GitHub id which is automatically assigned.

The command below can be used to get the release information, in the form of json, which includes the tag id:

curl -H "Accept: application/vnd.github+json" -H "Authorization: token ghp_authorizationtoken" https://api.github.com/repos/username/repository name/releases/tags/required tag