latest_tag = "0.0.0" for tag in tags: if tag.name.startswith( 'v' ): if tag.name.replace('v','').replace('.','') > latest_tag.replace('.',''): latest_tag = tag.name.replace('v','')