@@ -44,7 +44,8 @@ func GetLatestCLIRelease(ctx context.Context) (string, error) {
4444 if err != nil {
4545 return "" , fmt .Errorf ("unmarshaling manifest response: %w" , err )
4646 }
47- return extractVersionFromTag (mr .Latest ), nil
47+ tag := strings .TrimPrefix (mr .Latest , "cli-" )
48+ return tag , nil
4849}
4950
5051func getLatestCQPluginRelease (ctx context.Context , name string , typ PluginType ) (string , error ) {
@@ -58,14 +59,8 @@ func getLatestCQPluginRelease(ctx context.Context, name string, typ PluginType)
5859 if err != nil {
5960 return "" , fmt .Errorf ("unmarshaling manifest response: %w" , err )
6061 }
61- return extractVersionFromTag (mr .Latest ), nil
62- }
63-
64- // extractVersionFromTag takes a tag of the form "plugins-source-test-v0.1.21" and returns
65- // the version, i.e. "v0.1.21"
66- func extractVersionFromTag (tag string ) string {
67- parts := strings .Split (tag , "-" )
68- return parts [len (parts )- 1 ]
62+ version := strings .TrimPrefix (mr .Latest , fmt .Sprintf ("plugins-%s-%s-" , string (typ ), name ))
63+ return version , nil
6964}
7065
7166func getLatestCommunityPluginRelease (ctx context.Context , org , name string , typ PluginType ) (string , error ) {
0 commit comments