From 8785f8cb9608012e3db8a036954139321611339b Mon Sep 17 00:00:00 2001 From: motatoes Date: Wed, 13 Nov 2024 23:09:23 +0000 Subject: [PATCH] fix conditionals --- backend/utils/github.go | 4 ---- ee/backend/providers/github/providers.go | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/backend/utils/github.go b/backend/utils/github.go index df356b73..94dc010b 100644 --- a/backend/utils/github.go +++ b/backend/utils/github.go @@ -114,10 +114,6 @@ func (gh DiggerGithubRealClientProvider) FetchCredentials(githubAppId string) (s clientSecret := os.Getenv("GITHUB_APP_CLIENT_SECRET") webhookSecret := os.Getenv("GITHUB_WEBHOOK_SECRET") privateKeyb64 := os.Getenv("GITHUB_APP_PRIVATE_KEY_BASE64") - - if clientId == "" || clientSecret == "" || webhookSecret == "" || privateKeyb64 == "" { - return "", "", "", "", fmt.Errorf("the values of GITHUB_APP_CLIENT_ID or GITHUB_APP_CLIENT_SECRET are not set") - } return clientId, clientSecret, webhookSecret, privateKeyb64, nil } diff --git a/ee/backend/providers/github/providers.go b/ee/backend/providers/github/providers.go index c3421864..47a83679 100644 --- a/ee/backend/providers/github/providers.go +++ b/ee/backend/providers/github/providers.go @@ -101,7 +101,7 @@ func (gh DiggerGithubEEClientProvider) FetchCredentials(githubAppId string) (str webhookSecret := os.Getenv("GITHUB_WEBHOOK_SECRET") privateKeyb64 := os.Getenv("GITHUB_APP_PRIVATE_KEY_BASE64") - if clientId == "" || clientSecret == "" || webhookSecret == "" || privateKeyb64 == "" { + if clientId != "" && clientSecret != "" && webhookSecret != "" && privateKeyb64 != "" { log.Printf("Info: found github client credentials from env variables, using those") return clientId, clientSecret, webhookSecret, privateKeyb64, nil }