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

Function sanitizeJobName

pkg/workflow/strings.go:235–239  ·  view source on GitHub ↗

sanitizeJobName converts a workflow name to a valid GitHub Actions job name. It delegates normalization to NormalizeSafeOutputIdentifier (which converts hyphens to underscores), then converts underscores back to hyphens for GitHub Actions job name conventions.

(workflowName string)

Source from the content-addressed store, hash-verified

233// hyphens to underscores), then converts underscores back to hyphens for
234// GitHub Actions job name conventions.
235func sanitizeJobName(workflowName string) string {
236 normalized := stringutil.NormalizeSafeOutputIdentifier(workflowName)
237 // NormalizeSafeOutputIdentifier uses underscores; convert to hyphens for job names
238 return strings.ReplaceAll(normalized, "_", "-")
239}
240
241// sanitizeRefForPath sanitizes a git ref for use in a file path.
242// Replaces characters that are problematic in file paths with safe alternatives.

Callers 2

buildCallWorkflowJobsMethod · 0.85
TestSanitizeJobNameFunction · 0.85

Calls 1

Tested by 1

TestSanitizeJobNameFunction · 0.68