compileWorkflow automatically compiles the generated workflow
(ctx context.Context, verbose bool)
| 746 | |
| 747 | // compileWorkflow automatically compiles the generated workflow |
| 748 | func (b *InteractiveWorkflowBuilder) compileWorkflow(ctx context.Context, verbose bool) error { |
| 749 | interactiveLog.Printf("Starting workflow compilation: name=%s, verbose=%v", b.WorkflowName, verbose) |
| 750 | |
| 751 | // Create spinner for compilation progress |
| 752 | spinner := console.NewSpinner("Compiling your workflow...") |
| 753 | spinner.Start() |
| 754 | |
| 755 | // Use the existing compile functionality |
| 756 | config := CompileConfig{ |
| 757 | MarkdownFiles: []string{b.WorkflowName}, |
| 758 | Verbose: verbose, |
| 759 | EngineOverride: "", |
| 760 | Validate: true, |
| 761 | Watch: false, |
| 762 | WorkflowDir: "", |
| 763 | SkipInstructions: false, |
| 764 | NoEmit: false, |
| 765 | Purge: false, |
| 766 | TrialMode: false, |
| 767 | TrialLogicalRepoSlug: "", |
| 768 | } |
| 769 | |
| 770 | _, err := CompileWorkflows(ctx, config) |
| 771 | |
| 772 | if err != nil { |
| 773 | spinner.Stop() |
| 774 | fmt.Fprintln(os.Stderr, console.FormatErrorMessage(fmt.Sprintf("Compilation failed: %v", err))) |
| 775 | return err |
| 776 | } |
| 777 | |
| 778 | // Stop spinner with success message |
| 779 | spinner.StopWithMessage("✓ Workflow compiled successfully!") |
| 780 | fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("You can now find your compiled workflow at .github/workflows/%s.lock.yml", b.WorkflowName))) |
| 781 | |
| 782 | return nil |
| 783 | } |
| 784 | |
| 785 | // buildSafeOutputOptions loads safe output tool options from safe_outputs_tools.json |
| 786 | // and returns them as huh form options. |