MCPcopy Create free account
hub / github.com/github/gh-aw / SanitizeArtifactIdentifier

Function SanitizeArtifactIdentifier

pkg/workflow/strings.go:286–297  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

284//
285// See package documentation for guidance on when to use sanitize vs normalize patterns.
286func 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}

Callers 2

renderGitHubTOMLMethod · 0.85

Calls 2

SanitizeNameFunction · 0.70
PrintfMethod · 0.45

Tested by 1