def get_valid_versions_for_repo(repo):
    """
    Retrieve valid versions (tags) for a particular repo (pack).

    It does so by introspecting available tags.

    :rtype: ``list`` of ``str``
    """
    valid_versions = []

    for tag in repo.tags:
        if tag.name.startswith("v") and re.match(PACK_VERSION_REGEX, tag.name[1:]):
            # Note: We strip leading "v" from the version number
            valid_versions.append(tag.name[1:])

    return valid_versions

    Retrieve valid versions (tags) for a particular repo (pack).

    It does so by introspecting available tags.

    :rtype: ``list`` of ``str``
    
st2common/st2common/util/pack_management.py