Skip to content

Commit

Permalink
Print more helpful error if GITHUB_TOKEN not set
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbeaumont committed Oct 5, 2020
1 parent b1ef941 commit 08850b6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/gitops/deploykey/deploykey.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ func GetDeployKeyClient(ctx context.Context, url string) (gitprovider.DeployKeyC
return nil, errors.New("only GitHub URLs are currently supported")
}
githubToken := os.Getenv(githubTokenVariable)
if githubToken == "" {
return nil, errors.Errorf("%s not set", githubTokenVariable)
}
gh, err := github.NewClient(github.WithOAuth2Token(githubToken))
if err != nil {
return nil, err
Expand Down

0 comments on commit 08850b6

Please sign in to comment.