From 367426a1f9f383811906109414fe5ef5cf4e9668 Mon Sep 17 00:00:00 2001 From: Gorbunov Kirill Andreevich Date: Thu, 21 Mar 2024 15:45:29 +0300 Subject: [PATCH] #8 add log fo check pull. --- internal/source/gitea/gitea.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/source/gitea/gitea.go b/internal/source/gitea/gitea.go index fd3938f..c527081 100644 --- a/internal/source/gitea/gitea.go +++ b/internal/source/gitea/gitea.go @@ -145,6 +145,7 @@ func (g *Gitea) RequestOpen(ctx context.Context, branch string, path string, mod } for _, pull := range pulls { + logger.Info(ctx, fmt.Sprintf("PULL title - %s | ref - %s", pull.Title, pull.Base.Ref)) if strings.Contains(pull.Title, path) && strings.Contains(pull.Base.Ref, branch) { logger.Info(ctx, fmt.Sprintf("skip %s as pr already exists %s", path, pull.URL)) return ErrPRExist @@ -175,7 +176,8 @@ func (g *Gitea) RequestOpen(ctx context.Context, branch string, path string, mod Create: true, Force: true, }); err != nil { - logger.Fatal(ctx, fmt.Sprintf("failed to checkout tree: %v", err)) + logger.Error(ctx, fmt.Sprintf("failed to checkout tree: %v", err)) + return err } //создаем новую ветку epath, err := exec.LookPath("go")