Skip to content

Commit

Permalink
fix conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
motatoes committed Nov 13, 2024
1 parent 504dfc8 commit 8785f8c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions backend/utils/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion ee/backend/providers/github/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 8785f8c

Please sign in to comment.