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

Function ActionsValidateCommand

pkg/cli/actions_build_command.go:57–92  ·  view source on GitHub ↗

ActionsValidateCommand validates all action.yml files

()

Source from the content-addressed store, hash-verified

55
56// ActionsValidateCommand validates all action.yml files
57func ActionsValidateCommand() error {
58 actionsDir := "actions"
59
60 actionsBuildLog.Print("Starting actions validation")
61
62 // Get list of action directories
63 actionDirs, err := getActionDirectories(actionsDir)
64 if err != nil {
65 return err
66 }
67
68 if len(actionDirs) == 0 {
69 fmt.Fprintln(os.Stderr, console.FormatWarningMessage("No action directories found in actions/"))
70 return nil
71 }
72
73 fmt.Fprintln(os.Stderr, console.FormatInfoMessage("✅ Validating all actions"))
74
75 allValid := true
76 for _, actionName := range actionDirs {
77 actionPath := filepath.Join(actionsDir, actionName)
78 if err := validateActionYml(actionPath); err != nil {
79 fmt.Fprintln(os.Stderr, console.FormatErrorMessage(fmt.Sprintf("✗ %s/action.yml: %s", actionName, err.Error())))
80 allValid = false
81 } else {
82 fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf(" ✓ %s/action.yml is valid", actionName)))
83 }
84 }
85
86 if !allValid {
87 return errors.New("validation failed for one or more actions")
88 }
89
90 fmt.Fprintln(os.Stderr, console.FormatSuccessMessage("✨ All actions valid"))
91 return nil
92}
93
94// ActionsCleanCommand removes generated index.js files from all actions
95func ActionsCleanCommand() error {

Callers 3

mainFunction · 0.92

Calls 8

FormatWarningMessageFunction · 0.92
FormatInfoMessageFunction · 0.92
FormatErrorMessageFunction · 0.92
FormatSuccessMessageFunction · 0.92
getActionDirectoriesFunction · 0.85
validateActionYmlFunction · 0.85
PrintMethod · 0.80
ErrorMethod · 0.45