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 <[email protected]>
Signed-off-by: Marco Lecheler <[email protected]>

Signed-off-by: Marco Lecheler <[email protected]>
Co-authored-by: crenshaw-dev <[email protected]>
  • Loading branch information
fty4 and crenshaw-dev authored Dec 8, 2022
1 parent a3a3e8d commit 07c0ee5
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 07c0ee5

Please sign in to comment.