From 0769aa3015a3fae956c39f18bac8ddfacf0994b1 Mon Sep 17 00:00:00 2001 From: janiskemper Date: Mon, 18 Sep 2023 17:11:34 +0200 Subject: [PATCH] :bug: Remove redundant check for git token Removing the redundant check for the git token that breaks in open-source repos where there is no need for a token --- pkg/github/client/credentials.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/github/client/credentials.go b/pkg/github/client/credentials.go index 245fe8881..8fc8b7166 100644 --- a/pkg/github/client/credentials.go +++ b/pkg/github/client/credentials.go @@ -69,11 +69,7 @@ func NewGitConfig() (GitConfig, error) { } gitCfg.GitRepoName = val - val, ok = os.LookupEnv(EnvGitAccessToken) - if val == "" || !ok { - return GitConfig{}, fmt.Errorf("environment variable %s is not set", EnvGitAccessToken) - } - gitCfg.GitAccessToken = val + gitCfg.GitAccessToken, ok = os.LookupEnv(EnvGitAccessToken) return gitCfg, nil }