ActionsBuildCommand builds all custom GitHub Actions by bundling JavaScript dependencies
()
| 25 | |
| 26 | // ActionsBuildCommand builds all custom GitHub Actions by bundling JavaScript dependencies |
| 27 | func ActionsBuildCommand() error { |
| 28 | actionsDir := "actions" |
| 29 | |
| 30 | actionsBuildLog.Print("Starting actions build") |
| 31 | |
| 32 | // Get list of action directories |
| 33 | actionDirs, err := getActionDirectories(actionsDir) |
| 34 | if err != nil { |
| 35 | return err |
| 36 | } |
| 37 | |
| 38 | if len(actionDirs) == 0 { |
| 39 | fmt.Fprintln(os.Stderr, console.FormatWarningMessage("No action directories found in actions/")) |
| 40 | return nil |
| 41 | } |
| 42 | |
| 43 | fmt.Fprintln(os.Stderr, console.FormatInfoMessage("Building all actions...")) |
| 44 | |
| 45 | // Build each action |
| 46 | for _, actionName := range actionDirs { |
| 47 | if err := buildAction(actionsDir, actionName); err != nil { |
| 48 | return fmt.Errorf("failed to build action %s: %w", actionName, err) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | fmt.Fprintln(os.Stderr, console.FormatSuccessMessage(fmt.Sprintf("✨ All actions built successfully (%d actions)", len(actionDirs)))) |
| 53 | return nil |
| 54 | } |
| 55 | |
| 56 | // ActionsValidateCommand validates all action.yml files |
| 57 | func ActionsValidateCommand() error { |