Skip to content

Commit 1b58073

Browse files
WIP
1 parent 4cdb6b8 commit 1b58073

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

oci/artefact.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ func (c *Client) PushArtefact(ctx context.Context, destinationRef, sourceDir str
354354
return "", fmt.Errorf("adding alias tagging failed: %w", err)
355355
}
356356
}
357-
357+
// TODO: reteurn tag and all of its aliases
358358
return tagAliases[0].String() + "@" + digest.String(), err
359359
}
360360

@@ -372,22 +372,22 @@ func SemVerTagsFromAttestations(ctx context.Context, tag name.Tag, sourceAttesta
372372
if len(entries.EntryGroups[0]) == 0 {
373373
return []name.Tag{}
374374
}
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)
376378
if !ok {
377379
return []name.Tag{}
378380
}
379-
if len(groupSummary.Reference.Tags) == 0 {
381+
ref := groupSummary.Git.Reference
382+
if len(ref.Tags) == 0 {
380383
return []name.Tag{}
381384
}
382-
383-
tags := make([]name.Tag, 0, len(groupSummary.Reference.Tags))
384-
385385
// 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))
391391
}
392392
}
393393
if len(tags) == 0 {

0 commit comments

Comments
 (0)