Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
Fix: Check for git authentication when GITHUB_TOKEN exists (#463)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeongwon Song <[email protected]>
  • Loading branch information
jsong336 committed Feb 20, 2024
1 parent 9c87165 commit 6488cc8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/github/githubutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,12 @@ func GetGHRepoService() GHRepoService {
gh = github.NewClient(oauth2.NewClient(context.Background(), oauth2.StaticTokenSource(
&oauth2.Token{AccessToken: os.Getenv("GITHUB_TOKEN")},
)))
} else {
if _, err := ListReleases(flyte, gh.Repositories); err != nil {
logger.Warnf(context.Background(), "Found GITHUB_TOKEN but failed to fetch releases. Using empty http.Client: %s.", err)
gh = nil
}
}
if gh == nil {
gh = github.NewClient(&http.Client{})
}
return gh.Repositories
Expand Down

0 comments on commit 6488cc8

Please sign in to comment.