@@ -354,7 +354,7 @@ func (c *Client) PushArtefact(ctx context.Context, destinationRef, sourceDir str
354
354
return "" , fmt .Errorf ("adding alias tagging failed: %w" , err )
355
355
}
356
356
}
357
-
357
+ // TODO: reteurn tag and all of its aliases
358
358
return tagAliases [0 ].String () + "@" + digest .String (), err
359
359
}
360
360
@@ -372,22 +372,22 @@ func SemVerTagsFromAttestations(ctx context.Context, tag name.Tag, sourceAttesta
372
372
if len (entries .EntryGroups [0 ]) == 0 {
373
373
return []name.Tag {}
374
374
}
375
- groupSummary , ok := entries .EntryGroups [0 ][0 ].Full ().(* git.GitSummary )
375
+
376
+ // TODO: try to use generics for this?
377
+ groupSummary , ok := entries .EntryGroups [0 ][0 ].Full ().(* git.Summary )
376
378
if ! ok {
377
379
return []name.Tag {}
378
380
}
379
- if len (groupSummary .Reference .Tags ) == 0 {
381
+ ref := groupSummary .Git .Reference
382
+ if len (ref .Tags ) == 0 {
380
383
return []name.Tag {}
381
384
}
382
-
383
- tags := make ([]name.Tag , 0 , len (groupSummary .Reference .Tags ))
384
-
385
385
// TODO: detect tags with groupSummary.Path+"/" as prefix and priorities them
386
- for i := range groupSummary . Reference . Tags {
387
- t := groupSummary . Reference . Tags [ i ]. Name
388
- fmt . Println ( t )
389
- if semver .IsValid (t ) {
390
- tags = append (tags , tag .Context ().Tag (t ))
386
+ tags := make ([]name. Tag , 0 , len ( ref . Tags ))
387
+ for i := range ref . Tags {
388
+ t := ref . Tags [ i ]. Name
389
+ if semver .IsValid (t ) || semver . IsValid ( "v" + t ) {
390
+ tags = append (tags , tag .Context ().Tag (ref . Tags [ i ]. Name ))
391
391
}
392
392
}
393
393
if len (tags ) == 0 {
0 commit comments