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: warn if list has multiple files with same name #3607

Merged
merged 1 commit into from Nov 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions internal/artifact/artifact.go
Expand Up @@ -289,6 +289,17 @@ func New() Artifacts {
func (artifacts Artifacts) List() []*Artifact {
artifacts.lock.Lock()
defer artifacts.lock.Unlock()
names := map[string]bool{}
for _, item := range artifacts.items {
if item.Name == "" {
continue
}
if names[item.Name] {
log.WithField("name", item.Name).
Warn("multiple artifacts with the same name: this may cause errors")
}
names[item.Name] = true
}
return artifacts.items
}

Expand Down