#8 skip path if branch exists (#12)

Co-authored-by: Gorbunov Kirill Andreevich <kgorbunov@mtsbank.ru>
Reviewed-on: #12
Co-authored-by: Кирилл Горбунов <kirya_gorbunov_2015@mail.ru>
Co-committed-by: Кирилл Горбунов <kirya_gorbunov_2015@mail.ru>
This commit is contained in:
Кирилл Горбунов
2024-04-03 08:28:16 +03:00
parent eb2a21a1b1
commit bf99e383e3
5 changed files with 10 additions and 15 deletions

View File

@@ -260,6 +260,10 @@ func Execute(ctx context.Context, gitSource source.SourceControl, mvs map[string
logger.Debugf(ctx, fmt.Sprintf("Start update %s from %s to %s", path, mod.Module.Version, mod.Version))
err := gitSource.RequestOpen(ctx, branch, path, mod)
if err != nil {
if strings.Contains(err.Error(), "already exists") {
logger.Debugf(ctx, fmt.Sprintf("skip %s, branch already exists"), path)
continue
}
logger.Fatal(ctx, fmt.Sprintf("failed to create pr: %v", err))
}
logger.Debugf(ctx, fmt.Sprintf("Update successful for %s", path))