Просмотр исходного кода

fix casing to be on when environment exists

Alexander Belanger 4 лет назад
Родитель
Сommit
e4ca8de27a
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      internal/integrations/ci/actions/preview.go

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

@@ -133,7 +133,7 @@ func DeleteEnv(opts *EnvOpts) error {
 		opts.EnvironmentName,
 	)
 
-	if resp != nil && resp.StatusCode == http.StatusNotFound {
+	if err == nil && resp != nil && resp.StatusCode == http.StatusOK {
 		_, err = opts.Client.Repositories.DeleteEnvironment(
 			context.Background(),
 			opts.GitRepoOwner,