You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to get the tag from a commit id?
Well, I guess it is possible by searching the tags in the submodule repository.
Is that too much work though?
Ideally we should be able to fetch the data we need to render a badge in a single API call for performance reasons (we need to be able to fetch the data and render the badge inside a request/response cycle). This would require multiple calls and worst-case could require paging over results to find a match. I don't think there is a direct API query for "get all tags for this commit hash"
The other one is that a tag is associated with exactly one commit, but a commit can be associated with many tags. Many repos use a linear tag history, but for example if you consider a repo like https://github.com/gatsbyjs/gatsby the commit e8e17e77 is tagged with
I also think the conversation and concerns articulated on #4934 remain relevant and would move to close this (with #9996 continuing to have some submodule related badges worth potentially considering)
Activity
chris48s commentedon May 20, 2025
I think git submodules are only associated with a commit, not a tag
Tag isn't an available field
https://docs.github.com/en/graphql/reference/objects#submodule
RadAd commentedon May 21, 2025
Is it possible to get the tag from a commit id?
Well, I guess it is possible by searching the tags in the submodule repository.
Is that too much work though?
chris48s commentedon May 21, 2025
I think there's a couple of problems.
Ideally we should be able to fetch the data we need to render a badge in a single API call for performance reasons (we need to be able to fetch the data and render the badge inside a request/response cycle). This would require multiple calls and worst-case could require paging over results to find a match. I don't think there is a direct API query for "get all tags for this commit hash"
The other one is that a tag is associated with exactly one commit, but a commit can be associated with many tags. Many repos use a linear tag history, but for example if you consider a repo like https://github.com/gatsbyjs/gatsby the commit
e8e17e77is tagged withbut if all you have is
e8e17e77, how would you choose which one?I think this one would be impractical, unfortunately.
calebcartwright commentedon May 21, 2025
I also think the conversation and concerns articulated on #4934 remain relevant and would move to close this (with #9996 continuing to have some submodule related badges worth potentially considering)
feat: add submodule support to GitHub tag service (badges#11096)
[-]Add submodule supprt to GitHub tag[/-]