Browse Source

return 200 if PR was created

Mohammed Nafees 3 years ago
parent
commit
5adb7075b8
1 changed files with 5 additions and 0 deletions
  1. 5 0
      api/server/handlers/environment/create.go

+ 5 - 0
api/server/handlers/environment/create.go

@@ -152,6 +152,11 @@ func (c *CreateEnvironmentHandler) deleteEnvAndReportError(
 	}
 
 	if strings.Contains(err.Error(), "protected branch") {
+		if strings.Contains(err.Error(), "Please merge") {
+			c.HandleAPIError(w, r, apierrors.NewErrPassThroughToClient(err, http.StatusOK))
+			return
+		}
+
 		c.HandleAPIError(w, r, apierrors.NewErrPassThroughToClient(
 			fmt.Errorf("Error creating preview environment workflow files on protected branch"), http.StatusConflict,
 		))