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

Function SanitizeWorkflowIDForCacheKey

pkg/workflow/strings.go:223–229  ·  view source on GitHub ↗

SanitizeWorkflowIDForCacheKey sanitizes a workflow ID for use in cache keys. It removes all hyphens and converts to lowercase to create a filesystem-safe identifier. Example: "Smoke-Copilot" -> "smokecopilot"

(workflowID string)

Source from the content-addressed store, hash-verified

221// It removes all hyphens and converts to lowercase to create a filesystem-safe identifier.
222// Example: "Smoke-Copilot" -> "smokecopilot"
223func SanitizeWorkflowIDForCacheKey(workflowID string) string {
224 // Convert to lowercase
225 sanitized := strings.ToLower(workflowID)
226 // Remove all hyphens
227 sanitized = strings.ReplaceAll(sanitized, "-", "")
228 return sanitized
229}
230
231// sanitizeJobName converts a workflow name to a valid GitHub Actions job name.
232// It delegates normalization to NormalizeSafeOutputIdentifier (which converts

Calls 1

ToLowerMethod · 0.80

Tested by 1