Skip to content

Commit

Permalink
always set right provider in ee (#1868)
Browse files Browse the repository at this point in the history
  • Loading branch information
motatoes authored Jan 8, 2025
1 parent d6e8d26 commit de0a222
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ee/cli/pkg/vcs/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 == "" {
Expand Down

0 comments on commit de0a222

Please sign in to comment.