fixed creating prs and returning early

This commit is contained in:
2022-09-21 22:46:55 +02:00
parent f4290d8300
commit be40a497ca
6 changed files with 28 additions and 17 deletions

View File

@@ -1,6 +1,9 @@
package commands
import (
"context"
"time"
"git.front.kjuulh.io/kjuulh/octopush/internal/cli"
"git.front.kjuulh.io/kjuulh/octopush/internal/commands"
"github.com/spf13/cobra"
@@ -23,11 +26,18 @@ func CreateOctopushProcessCmd(logger *zap.Logger) *cobra.Command {
ctx := cmd.Context()
deps, err := cli.Start(ctx, logger)
deps, cleanupFunc, err := cli.Start(ctx, logger)
if err != nil {
return err
}
defer func() {
ctx, _ = context.WithTimeout(ctx, time.Second*5)
if err := cleanupFunc(ctx); err != nil {
panic(err)
}
}()
err = commands.
NewProcessRepos(logger, deps).
Process(ctx, actionsRepo, branch, path)