From 3988e81157baf745368343bc0c9645a57bc6ba41 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sat, 30 Sep 2023 01:18:30 +0300 Subject: [PATCH] update Signed-off-by: Vasiliy Tolstov --- cmd/pkgdashcli/main.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/cmd/pkgdashcli/main.go b/cmd/pkgdashcli/main.go index d9d4126..2f510a0 100644 --- a/cmd/pkgdashcli/main.go +++ b/cmd/pkgdashcli/main.go @@ -27,7 +27,7 @@ import ( var ( DefaultPullRequestTitle = `Bump {{.Name}} from {{.VersionOld}} to {{.VersionNew}}` - DefaultPullRequestBody = `Bumps {{.Name}} from {{.VersionOld}} to {{.VersionNew}}.` + DefaultPullRequestBody = `Bumps {{.Name}} from {{.VersionOld}} to {{.VersionNew}}` ) type Config struct { @@ -219,6 +219,10 @@ func giteaPullRequest(ctx context.Context, cfg *Config, mods map[string]modules. logger.Fatalf(ctx, "failed to create repo branch: %v", err) } + if err = repo.Push(&git.PushOptions{}); err != nil { + logger.Fatalf(ctx, "failed to push repo branch: %v", err) + } + data := map[string]string{ "Name": path, "VersionOld": mod.Module.Version, @@ -246,16 +250,6 @@ func giteaPullRequest(ctx context.Context, cfg *Config, mods map[string]modules. } logger.Infof(ctx, "marshal body: %s", buf) - /* - 'https://try.gitea.io/api/v1/repos/org/repo/pulls?token=myaccesstoken' \ - -H 'accept: application/json' \ - -H 'Content-Type: application/json' \ - -d '{ - "base": "main", - "body": "This is a PR", - "head": "username:feature-branch", - "title": "PR title" - */ req, err := http.NewRequestWithContext(ctx, http.MethodPost, envAPIURL+"/repos/"+envREPOSITORY+"/pulls?token="+envTOKEN, bytes.NewReader(buf)) if err != nil {