Skip to content

Commit 8785f8c

Browse files
committed
fix conditionals
1 parent 504dfc8 commit 8785f8c

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

backend/utils/github.go

-4
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,6 @@ func (gh DiggerGithubRealClientProvider) FetchCredentials(githubAppId string) (s
114114
clientSecret := os.Getenv("GITHUB_APP_CLIENT_SECRET")
115115
webhookSecret := os.Getenv("GITHUB_WEBHOOK_SECRET")
116116
privateKeyb64 := os.Getenv("GITHUB_APP_PRIVATE_KEY_BASE64")
117-
118-
if clientId == "" || clientSecret == "" || webhookSecret == "" || privateKeyb64 == "" {
119-
return "", "", "", "", fmt.Errorf("the values of GITHUB_APP_CLIENT_ID or GITHUB_APP_CLIENT_SECRET are not set")
120-
}
121117
return clientId, clientSecret, webhookSecret, privateKeyb64, nil
122118
}
123119

ee/backend/providers/github/providers.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func (gh DiggerGithubEEClientProvider) FetchCredentials(githubAppId string) (str
101101
webhookSecret := os.Getenv("GITHUB_WEBHOOK_SECRET")
102102
privateKeyb64 := os.Getenv("GITHUB_APP_PRIVATE_KEY_BASE64")
103103

104-
if clientId == "" || clientSecret == "" || webhookSecret == "" || privateKeyb64 == "" {
104+
if clientId != "" && clientSecret != "" && webhookSecret != "" && privateKeyb64 != "" {
105105
log.Printf("Info: found github client credentials from env variables, using those")
106106
return clientId, clientSecret, webhookSecret, privateKeyb64, nil
107107
}

0 commit comments

Comments
 (0)