Skip to content

Add submodule support to GitHub tag #11096

Open

Description

@RadAd

On GitHub the submodule is only shown as a commit id.

I would like to know the tag (if any) associated with that tag.

eg:
https://img.shields.io/github/v/tag/:user:/:repo:/:submodule:

Would that be possible?

Activity

  1. chris48s commented on May 20, 2025

    @chris48s
    Member

    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

  2. RadAd commented on May 21, 2025

    @RadAd
    Author

    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?

  3. chris48s commented on May 21, 2025

    @chris48s
    Member

    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 e8e17e77 is tagged with

    but if all you have is e8e17e77, how would you choose which one?

    I think this one would be impractical, unfortunately.

  4. calebcartwright commented on May 21, 2025

    @calebcartwright
    Member

    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)

  5. changed the title [-]Add submodule supprt to GitHub tag[/-] on Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    service-badgeNew or updated service badge

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions