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

Function runDeploy

pkg/cli/deploy_command.go:50–83  ·  view source on GitHub ↗
(ctx context.Context, targetRepo string, workflows []string, addOpts AddOptions, coolDown time.Duration)

Source from the content-addressed store, hash-verified

48}
49
50func runDeploy(ctx context.Context, targetRepo string, workflows []string, addOpts AddOptions, coolDown time.Duration) error {
51 checkoutDir, originalDir, err := prepareDeployCheckout(ctx, targetRepo)
52 if err != nil {
53 return err
54 }
55 defer func() {
56 _ = os.Chdir(originalDir)
57 }()
58
59 resolvedWorkflows := resolveDeployWorkflowSpecs(workflows, originalDir)
60
61 if err := os.Chdir(checkoutDir); err != nil {
62 return fmt.Errorf("failed to change directory to checkout %s: %w", checkoutDir, err)
63 }
64
65 if err := runDeployUpdatePass(ctx, addOpts, coolDown); err != nil {
66 return err
67 }
68
69 if err := runDeployAddPass(ctx, resolvedWorkflows, addOpts); err != nil {
70 return err
71 }
72
73 if err := runDeployCompilePass(ctx, addOpts); err != nil {
74 return err
75 }
76
77 if err := createDeployPR(resolvedWorkflows, targetRepo, addOpts.Verbose); err != nil {
78 return err
79 }
80
81 deployLog.Printf("Successfully deployed workflows to %s", targetRepo)
82 return nil
83}
84
85func validateDeployArgs(cmd *cobra.Command, args []string) error {
86 if len(args) < 1 {

Callers

nothing calls this directly

Calls 8

prepareDeployCheckoutFunction · 0.85
runDeployUpdatePassFunction · 0.85
runDeployAddPassFunction · 0.85
runDeployCompilePassFunction · 0.85
createDeployPRFunction · 0.85
ErrorfMethod · 0.45
PrintfMethod · 0.45

Tested by

no test coverage detected