From daf61c2a44760070b6275b1bc46582cb17b461d2 Mon Sep 17 00:00:00 2001 From: Aditya Hegde Date: Mon, 30 Dec 2024 10:05:44 +0530 Subject: [PATCH] Fix github deploy without a checkout --- cli/cmd/project/connect_github.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/cli/cmd/project/connect_github.go b/cli/cmd/project/connect_github.go index c1500c81d1a..bab9c5fc5d5 100644 --- a/cli/cmd/project/connect_github.go +++ b/cli/cmd/project/connect_github.go @@ -91,13 +91,18 @@ func ConnectGithubFlow(ctx context.Context, ch *cmdutil.Helper, opts *DeployOpts } } - // If the Git path is local, we'll do some extra steps to infer the githubURL. - localGitPath, localProjectPath, err := ValidateLocalProject(ch, opts.GitPath, opts.SubPath) - if err != nil { - if errors.Is(err, ErrInvalidProject) { - return nil + var localGitPath string + var localProjectPath string + var err error + if isLocalGitPath { + // If the Git path is local, we'll do some extra steps to infer the githubURL. + localGitPath, localProjectPath, err = ValidateLocalProject(ch, opts.GitPath, opts.SubPath) + if err != nil { + if errors.Is(err, ErrInvalidProject) { + return nil + } + return err } - return err } if ch.Org != "" {