From 594edfd6d13084a5632b63035d4bc66de4bac6b0 Mon Sep 17 00:00:00 2001 From: Ryan Albert Date: Wed, 6 Mar 2024 09:47:01 -0800 Subject: [PATCH] feat: fix no sdk generated --- internal/actions/runWorkflow.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/actions/runWorkflow.go b/internal/actions/runWorkflow.go index c3457ffa..24bb8e91 100644 --- a/internal/actions/runWorkflow.go +++ b/internal/actions/runWorkflow.go @@ -2,6 +2,7 @@ package actions import ( "fmt" + "github.com/hashicorp/go-version" "github.com/speakeasy-api/sdk-generation-action/internal/git" "github.com/speakeasy-api/sdk-generation-action/internal/run" @@ -132,6 +133,11 @@ func RunWorkflow() error { // Sets outputs and creates or adds releases info func finalize(outputs map[string]string, branchName string, anythingRegenerated bool, g *git.Git) error { + // If nothing was regenerated, we don't need to do anything + if !anythingRegenerated { + return nil + } + branchName, err := g.FindBranch(branchName) if err != nil { return err @@ -145,11 +151,6 @@ func finalize(outputs map[string]string, branchName string, anythingRegenerated } }() - // If nothing was regenerated, we don't need to do anything - if !anythingRegenerated { - return nil - } - switch environment.GetMode() { case environment.ModePR: branchName, pr, err := g.FindExistingPR(branchName, environment.ActionFinalize)