Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion applicationset/services/pull_request/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ func NewGithubService(token, url, owner, repo string, labels []string) (PullRequ
httpClient := &http.Client{}
var client *github.Client
if url == "" {
client = github.NewClient(httpClient).WithAuthToken(token)
if token == "" {
client = github.NewClient(httpClient)
} else {
client = github.NewClient(httpClient).WithAuthToken(token)
}
} else {
var err error
client, err = github.NewClient(httpClient).WithEnterpriseURLs(url, url)
Expand Down
6 changes: 5 additions & 1 deletion applicationset/services/scm_provider/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ func NewGithubProvider(organization string, token string, url string, allBranche
httpClient := &http.Client{}
var client *github.Client
if url == "" {
client = github.NewClient(httpClient).WithAuthToken(token)
if token == "" {
client = github.NewClient(httpClient)
} else {
client = github.NewClient(httpClient).WithAuthToken(token)
}
} else {
var err error
client, err = github.NewClient(httpClient).WithEnterpriseURLs(url, url)
Expand Down
Loading