From 905e347d2a5bcfd09cd451c814f3b042ec5a195f Mon Sep 17 00:00:00 2001 From: Ryan Albert Date: Thu, 30 May 2024 13:43:52 -0700 Subject: [PATCH] feat: sdk action publishing improvements --- internal/git/releases.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/git/releases.go b/internal/git/releases.go index 70de5062..073b3569 100644 --- a/internal/git/releases.go +++ b/internal/git/releases.go @@ -69,7 +69,7 @@ func (g *Git) CreateRelease(releaseInfo releases.ReleasesInfo, outputs map[strin Body: github.String(fmt.Sprintf(`# Generated by Speakeasy CLI%s`, releaseInfo)), }) if err != nil { - if _, _, err = g.client.Repositories.GetReleaseByTag(context.Background(), os.Getenv("GITHUB_REPOSITORY_OWNER"), getRepo(), *tagName); err != nil { + if release, _, err := g.client.Repositories.GetReleaseByTag(context.Background(), os.Getenv("GITHUB_REPOSITORY_OWNER"), getRepo(), *tagName); err == nil && release != nil { fmt.Println(fmt.Sprintf("a github release with tag %s already existing ... skipping publishing")) fmt.Println(fmt.Sprintf("to publish this version again delete the github tag and release")) if _, ok := outputs[fmt.Sprintf("publish_%s", lang)]; ok {