util.go 306 B

123456789101112
  1. package preview
  2. import (
  3. "fmt"
  4. "strings"
  5. )
  6. func sanitizedRepoSuffix(repoOwner, repoName string) string {
  7. initialSuffix := fmt.Sprintf("%s-%s", repoOwner, repoName)
  8. sanitizedSuffix := strings.ReplaceAll(strings.ReplaceAll(initialSuffix, "_", "-"), ".", "-")
  9. return strings.ToLower(sanitizedSuffix)
  10. }