Skip to content

Commit

Permalink
fix: supoprt github enterprise token support (#86)
Browse files Browse the repository at this point in the history
supoprt github enterprise token support

Signed-off-by: Zach Aller <[email protected]>
  • Loading branch information
zachaller authored Oct 25, 2024
1 parent 59f12a2 commit ee3e372
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/scms/github/git_operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ func GetClient(secret v1.Secret, domain string) (*github.Client, error) {
}

var client *github.Client
if domain == "" || domain == "github.com" {
if domain == "" {
client = github.NewClient(&http.Client{Transport: itr})
} else {
baseURL := fmt.Sprintf("https://%s/api/v3", domain)
itr.BaseURL = baseURL
uploadsURL := fmt.Sprintf("https://%s/api/uploads", domain)
client, err = github.NewClient(&http.Client{Transport: itr}).WithEnterpriseURLs(baseURL, uploadsURL)
if err != nil {
Expand Down

0 comments on commit ee3e372

Please sign in to comment.