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

Function ValidateWorkflowName

pkg/cli/validators.go:18–30  ·  view source on GitHub ↗

ValidateWorkflowName checks if the provided workflow name is valid. It ensures the name is not empty and contains only alphanumeric characters, hyphens, and underscores.

(s string)

Source from the content-addressed store, hash-verified

16// ValidateWorkflowName checks if the provided workflow name is valid.
17// It ensures the name is not empty and contains only alphanumeric characters, hyphens, and underscores.
18func ValidateWorkflowName(s string) error {
19 validatorsLog.Printf("Validating workflow name: %s", s)
20 if s == "" {
21 validatorsLog.Print("Workflow name validation failed: empty name")
22 return errors.New("workflow name cannot be empty")
23 }
24 if !workflowNameRegex.MatchString(s) {
25 validatorsLog.Printf("Workflow name validation failed: invalid characters in %s", s)
26 return errors.New("workflow name must contain only alphanumeric characters, hyphens, and underscores")
27 }
28 validatorsLog.Printf("Workflow name validated successfully: %s", s)
29 return nil
30}
31
32// ValidateWorkflowIntent checks if the provided workflow intent is valid.
33// It ensures the intent has meaningful content with at least 20 characters

Calls 2

PrintMethod · 0.80
PrintfMethod · 0.45