Skip to content

Commit

Permalink
fix(ci): fix remote tag deletion/skipping
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Guerra <[email protected]>
  • Loading branch information
LucaGuerra committed Jan 18, 2024
1 parent 0503497 commit 3802892
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions build/registry/pkg/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,20 +227,26 @@ func newReleases(artifactName, remoteVersion string) ([]semver.Version, error) {
return append(versions, *v), nil
}

tags, err := git("--no-pager", "tag", "--list", tagPrefix, "--contains", remoteTag)
tagList, err := git("--no-pager", "tag", "--list", tagPrefix, "--contains", remoteTag)
if err != nil {
return nil, err
}

tags := make(map[string]struct{})

for _, t := range tagList {
tags[t] = struct{}{}
}

// Since the remoteTag is always self-contained, we remove it.
tags = tags[1:]
delete(tags, remoteTag)

// If not new versions are found then return.
if len(tags) == 0 {
return nil, nil
}

for _, tag := range tags {
for tag := range tags {

if tag == "" {
continue
Expand Down

0 comments on commit 3802892

Please sign in to comment.