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

Function inferWorkflowPathFromDisplayName

pkg/cli/logs_run_processor.go:532–546  ·  view source on GitHub ↗

inferWorkflowPathFromDisplayName derives a best-effort workflow file path from a workflow display name when the GitHub API returns an empty path for the run. The inference converts the display name to a kebab-case slug using the same character-replacement rules as the JS sanitizeWorkflowName helper

(displayName string)

Source from the content-addressed store, hash-verified

530// the workflow filename was chosen independently of its display name. It is only used
531// when no authoritative path is available.
532func inferWorkflowPathFromDisplayName(displayName string) string {
533 if displayName == "" {
534 return ""
535 }
536 // Match sanitizeWorkflowName.cjs: lowercase, replace :[\/\s] with "-",
537 // replace other non-identifier chars with "-", preserve "." and "_".
538 slug := stringutil.SanitizeName(displayName, &stringutil.SanitizeOptions{
539 PreserveSpecialChars: []rune{'.', '_'},
540 TrimHyphens: true,
541 })
542 if slug == "" {
543 return ""
544 }
545 return constants.WorkflowsDirSlash + slug + ".lock.yml"
546}
547
548// runHasDifcFilteredItems checks if a run's gateway logs contain any DIFC_FILTERED events.
549// It parses the gateway logs (falling back to rpc-messages.jsonl when gateway.jsonl is absent)

Callers 3

buildLogsDataFunction · 0.85

Calls 1

SanitizeNameFunction · 0.92

Tested by 1