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

Commit 6488cc8

Browse files
authored
Fix: Check for git authentication when GITHUB_TOKEN exists (#463)
Signed-off-by: Jeongwon Song <jeongwon412@gmail.com>
1 parent 9c87165 commit 6488cc8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/github/githubutil.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,12 @@ func GetGHRepoService() GHRepoService {
231231
gh = github.NewClient(oauth2.NewClient(context.Background(), oauth2.StaticTokenSource(
232232
&oauth2.Token{AccessToken: os.Getenv("GITHUB_TOKEN")},
233233
)))
234-
} else {
234+
if _, err := ListReleases(flyte, gh.Repositories); err != nil {
235+
logger.Warnf(context.Background(), "Found GITHUB_TOKEN but failed to fetch releases. Using empty http.Client: %s.", err)
236+
gh = nil
237+
}
238+
}
239+
if gh == nil {
235240
gh = github.NewClient(&http.Client{})
236241
}
237242
return gh.Repositories

0 commit comments

Comments
 (0)