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

Function NormalizeWorkflowName

pkg/stringutil/identifiers.go:29–41  ·  view source on GitHub ↗

NormalizeWorkflowName removes .md and .lock.yml extensions from workflow names. This is used to standardize workflow identifiers regardless of the file format. The function checks for extensions in order of specificity: 1. Removes .lock.yml extension (the compiled workflow format) 2. Removes .md ex

(name string)

Source from the content-addressed store, hash-verified

27// NormalizeWorkflowName("weekly-research.lock.yml") // returns "weekly-research"
28// NormalizeWorkflowName("my.workflow.md") // returns "my.workflow"
29func NormalizeWorkflowName(name string) string {
30 // Remove .lock.yml extension first (longer extension)
31 if before, ok := strings.CutSuffix(name, ".lock.yml"); ok {
32 return before
33 }
34
35 // Remove .md extension
36 if before, ok := strings.CutSuffix(name, ".md"); ok {
37 return before
38 }
39
40 return name
41}
42
43// NormalizeSafeOutputIdentifier converts dashes and periods to underscores for safe output
44// identifiers. This standardizes identifier format to the internal underscore-separated

Callers 8

normalizeWorkflowIDFunction · 0.92
ResolveWorkflowNameFunction · 0.92
FindWorkflowNameFunction · 0.92
GetWorkflowLockFileNameFunction · 0.92

Calls

no outgoing calls