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

Function selectJSONImportNameOverride

pkg/cli/fetch.go:383–401  ·  view source on GitHub ↗
(currentName string, wf *JSONWorkflow)

Source from the content-addressed store, hash-verified

381}
382
383func selectJSONImportNameOverride(currentName string, wf *JSONWorkflow) string {
384 if wf == nil {
385 return currentName
386 }
387
388 if name := sanitizeJSONImportName(wf.Name); name != "" {
389 return name
390 }
391
392 if rawTitle, ok := wf.Extra["title"]; ok {
393 if title, ok := rawTitle.(string); ok {
394 if sanitized := sanitizeJSONImportName(title); sanitized != "" {
395 return sanitized
396 }
397 }
398 }
399
400 return currentName
401}
402
403func sanitizeJSONImportName(value string) string {
404 value = strings.TrimSpace(value)

Callers 2

fetchGenericURLWorkflowFunction · 0.85

Calls 1

sanitizeJSONImportNameFunction · 0.85

Tested by 1