Fixed API changes based on new dependencies

The "github.com/google/go-github/v87/github" has API shape changes, therefore a mere go.mod dependency update was inadequate; this PR adds necessary changes for feature parity and tests.

Co-authored-by: Ryan Richard <richardry@vmware.com>
Signed-off-by: Volkan Özçelik <volkan.ozcelik@broadcom.com>
This commit is contained in:
Volkan Özçelik
2026-06-30 11:12:15 -07:00
committed by Ryan Richard
co-authored by Ryan Richard
parent 1ccfd13194
commit d14722396a
2 changed files with 27 additions and 13 deletions
+12 -2
View File
@@ -71,8 +71,18 @@ func NewGitHubClient(httpClient *http.Client, apiBaseURL, token string) (GitHubI
return nil, fmt.Errorf("%s: token cannot be empty string", errorPrefix)
}
client := github.NewClient(httpClient).WithAuthToken(token)
client.BaseURL = parsedURL
// go-github's WithEnterpriseURLs requires a non-empty upload URL even though
// Pinniped only calls read endpoints (Users.Get, Organizations.List,
// Teams.ListUserTeams), all of which use the base URL. The upload URL is never
// exercised today. It should be updated if an upload-style call is ever used.
client, err := github.NewClient(
github.WithHTTPClient(httpClient),
github.WithAuthToken(token),
github.WithEnterpriseURLs(parsedURL.String(), parsedURL.String()),
)
if err != nil {
return nil, fmt.Errorf("%s: %w", errorPrefix, err)
}
return &githubClient{
client: client,