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)
| 233 | // hyphens to underscores), then converts underscores back to hyphens for |
| 234 | // GitHub Actions job name conventions. |
| 235 | func 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. |