@@ -616,7 +616,19 @@ func getWorkflowInputs(markdownPath string) (map[string]*workflow.InputDefinitio
616616 return workflow .ParseInputDefinitions (inputsMap ), nil
617617}
618618
619- // validateWorkflowInputs validates that required inputs are provided and checks for typos
619+ // validateWorkflowInputs validates that required inputs are provided and checks for typos.
620+ //
621+ // This validation function is co-located with the run command implementation because:
622+ // - It's specific to the workflow run operation
623+ // - It's only called during workflow dispatch
624+ // - It provides immediate feedback before triggering the workflow
625+ //
626+ // The function validates:
627+ // - All required inputs are provided
628+ // - Provided input names match defined inputs (typo detection)
629+ // - Suggestions for misspelled input names
630+ //
631+ // This follows the principle that domain-specific validation belongs in domain files.
620632func validateWorkflowInputs (markdownPath string , providedInputs []string ) error {
621633 // Extract workflow inputs
622634 workflowInputs , err := getWorkflowInputs (markdownPath )
@@ -888,7 +900,19 @@ func getLatestWorkflowRunWithRetry(lockFileName string, repo string, verbose boo
888900 return nil , fmt .Errorf ("no workflow run found after %d attempts" , maxRetries )
889901}
890902
891- // validateRemoteWorkflow checks if a workflow exists in a remote repository and can be triggered
903+ // validateRemoteWorkflow checks if a workflow exists in a remote repository and can be triggered.
904+ //
905+ // This validation function is co-located with the run command implementation because:
906+ // - It's specific to remote workflow execution
907+ // - It's only called when running workflows in remote repositories
908+ // - It provides early validation before attempting workflow dispatch
909+ //
910+ // The function validates:
911+ // - The specified repository exists and is accessible
912+ // - The workflow file exists in the repository
913+ // - The workflow can be triggered via GitHub Actions API
914+ //
915+ // This follows the principle that domain-specific validation belongs in domain files.
892916func validateRemoteWorkflow (workflowName string , repoOverride string , verbose bool ) error {
893917 if repoOverride == "" {
894918 return fmt .Errorf ("repository must be specified for remote workflow validation" )
0 commit comments