diff --git a/pkg/gitops/deploykey/deploykey.go b/pkg/gitops/deploykey/deploykey.go index 074f91f615..afeb777f2c 100644 --- a/pkg/gitops/deploykey/deploykey.go +++ b/pkg/gitops/deploykey/deploykey.go @@ -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