SanitizeArtifactIdentifier sanitizes a workflow name to create a safe identifier suitable for use as a user agent string or similar context. This is a SANITIZE function (character validity pattern). Use this when creating identifiers that must be purely alphanumeric with hyphens, with no special ch
(name string)
| 284 | // |
| 285 | // See package documentation for guidance on when to use sanitize vs normalize patterns. |
| 286 | func SanitizeArtifactIdentifier(name string) string { |
| 287 | stringsLog.Printf("Sanitizing identifier: %s", name) |
| 288 | result := SanitizeName(name, &SanitizeOptions{ |
| 289 | PreserveSpecialChars: []rune{}, |
| 290 | TrimHyphens: true, |
| 291 | DefaultValue: "github-agentic-workflow", |
| 292 | }) |
| 293 | if result != name { |
| 294 | stringsLog.Printf("Sanitized identifier: %s -> %s", name, result) |
| 295 | } |
| 296 | return result |
| 297 | } |