Skip to content

Commit

Permalink
Merge pull request #45 from skilld-labs/truncatingoverridevalye
Browse files Browse the repository at this point in the history
Truncating override value to 7 chars to match artifact naming convention
  • Loading branch information
iignatevich authored Oct 7, 2024
2 parents fbcf59c + 5d05e68 commit 502a783
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ func (s *SyncAction) prepareArtifact(username, password, override string) error
s.saveKeyring = true
}

override = truncateOverride(override)

storage := ArtifactStorage{
repo: repo,
username: ci.Username,
Expand Down Expand Up @@ -377,3 +379,13 @@ func (s *SyncAction) composeVersion(oldVersion string, newVersion string) string

return version
}

func truncateOverride(override string) string {
truncateLength := 7

if len(override) > truncateLength {
log.Info("Truncated override value to %d chars: %s", truncateLength, override)
return override[:truncateLength]
}
return override
}

0 comments on commit 502a783

Please sign in to comment.