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

Function SanitizeWorkflowName

pkg/workflow/strings.go:122–128  ·  view source on GitHub ↗

SanitizeWorkflowName sanitizes a workflow name for use in artifact names and file paths. It converts the name to lowercase and replaces or removes characters that are invalid in YAML artifact names or filesystem paths. This is a SANITIZE function (character validity pattern). Use this when processi

(name string)

Source from the content-addressed store, hash-verified

120//
121// See package documentation for guidance on when to use sanitize vs normalize patterns.
122func SanitizeWorkflowName(name string) string {
123 return SanitizeName(name, &SanitizeOptions{
124 PreserveSpecialChars: []rune{'.', '_', '-'},
125 TrimHyphens: false,
126 DefaultValue: "",
127 })
128}
129
130// ShortenCommand creates a short identifier for bash commands in workflow logs.
131// It replaces newlines with spaces and truncates to 20 characters if needed.

Callers 4

TestSanitizeWorkflowNameFunction · 0.92
otelServiceNameFunction · 0.85
TestSanitizeWorkflowNameFunction · 0.85

Calls 1

SanitizeNameFunction · 0.70

Tested by 2

TestSanitizeWorkflowNameFunction · 0.74
TestSanitizeWorkflowNameFunction · 0.68