Is there an API to get a single Tag by its Tag name?

In GitHub branch APIs there is an API to fetch single branch by branch name:
GET /repos/{owner}/{repo}/branches/{branch}
for {branch}, we can pass branch name.

But when looking at the Tag API documentation, I can only see a get Tag API with 'tag_sha' value (not the tag name)
GET /repos/{owner}/{repo}/git/tags/{tag_sha}

In a situation where we need to get details on a particular tag by first finding out available tags in a repository after invoking the API: GET /repos/{owner}/{repo}/tags, we will not have any way of using above get Tag API due to not having the 'tag_sha' value in the response of GET /repos/{owner}/{repo}/tags

Is there any other way of getting a single Tag with name?

Hi @gbidsilva o/

It’s likely you’ve seen this by now, but this is available via GraphQL API:

…with the name value.

However for REST, I really don’t think so =(

Would you be willing to submit this idea via our feedback form?

I think it would be great to pass that along to our PMs, via the form. :bow:

Let us know if you might be able to do what you need through GraphQL and if you come up against any issues.

1 Like