Explorar o código

fix for head branch not exists at all

Mohammed Nafees %!s(int64=4) %!d(string=hai) anos
pai
achega
17f60cbc49
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      internal/integrations/ci/actions/preview.go

+ 2 - 2
internal/integrations/ci/actions/preview.go

@@ -397,7 +397,7 @@ func createNewBranch(
 	client *github.Client,
 	gitRepoOwner, gitRepoName, baseBranch, headBranch string,
 ) error {
-	_, _, err := client.Repositories.GetBranch(
+	_, resp, err := client.Repositories.GetBranch(
 		context.Background(), gitRepoOwner, gitRepoName, headBranch, true,
 	)
 
@@ -412,7 +412,7 @@ func createNewBranch(
 		if err != nil {
 			return err
 		}
-	} else {
+	} else if resp.StatusCode != http.StatusNotFound {
 		return err
 	}