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

Commit

Permalink
check for git authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
jsong336 committed Feb 17, 2024
1 parent 9c87165 commit 4664002
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/github/githubutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@ 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 {
gh = nil
}
}
if gh == nil {
gh = github.NewClient(&http.Client{})
}
return gh.Repositories
Expand Down

0 comments on commit 4664002

Please sign in to comment.