From de0a222175650e0b24dfbe0d175e0f761059ef14 Mon Sep 17 00:00:00 2001 From: Mohamed Habib Date: Wed, 8 Jan 2025 11:25:43 +0000 Subject: [PATCH] always set right provider in ee (#1868) --- ee/cli/pkg/vcs/providers.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ee/cli/pkg/vcs/providers.go b/ee/cli/pkg/vcs/providers.go index 1b5011ef2..d74700e15 100644 --- a/ee/cli/pkg/vcs/providers.go +++ b/ee/cli/pkg/vcs/providers.go @@ -37,6 +37,12 @@ func (v VCSProviderAdvanced) GetPrService(vcsSpec spec.VcsSpec) (ci.PullRequestS func (v VCSProviderAdvanced) GetOrgService(vcsSpec spec.VcsSpec) (ci.OrgService, error) { switch vcsSpec.VcsType { + case "github": + token := os.Getenv("GITHUB_TOKEN") + if token == "" { + return nil, fmt.Errorf("failed to get github service: GITHUB_TOKEN not specified") + } + return github2.GithubServiceProviderAdvanced{}.NewService(token, vcsSpec.RepoName, vcsSpec.RepoOwner) case "gitlab": token := os.Getenv("GITLAB_TOKEN") if token == "" {