Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): fix remote tag deletion/skipping #401

Merged
merged 1 commit into from
Jan 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading