Skip to content

Commit

Permalink
fix: only add baseURL in github_app client for GHE client (argoproj#1…
Browse files Browse the repository at this point in the history
…1622)

fixes argoproj#11613

Co-authored-by: crenshaw-dev <crenshaw-dev@users.noreply.github.com>
Signed-off-by: Marco Lecheler <marco.lecheler@mercedes-benz.com>

Signed-off-by: Marco Lecheler <marco.lecheler@mercedes-benz.com>
Co-authored-by: crenshaw-dev <crenshaw-dev@users.noreply.github.com>
Signed-off-by: emirot <emirot.nolan@gmail.com>
  • Loading branch information
2 people authored and emirot committed Jan 27, 2023
1 parent f903821 commit 494ff23
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions applicationset/services/internal/github_app/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ func Client(g github_app_auth.Authentication, url string) (*github.Client, error
if url == "" {
url = g.EnterpriseBaseURL
}
rt.BaseURL = url
var client *github.Client
httpClient := http.Client{Transport: rt}
if url == "" {
httpClient := http.Client{Transport: rt}
client = github.NewClient(&httpClient)
} else {
rt.BaseURL = url
httpClient := http.Client{Transport: rt}
client, err = github.NewEnterpriseClient(url, url, &httpClient)
if err != nil {
return nil, fmt.Errorf("failed to create github enterprise client: %w", err)
Expand Down

0 comments on commit 494ff23

Please sign in to comment.