From 20b6844054f80828d7f8f38798af457146d93797 Mon Sep 17 00:00:00 2001 From: Nikita Melnikov Date: Sat, 23 Sep 2023 22:48:48 +0200 Subject: [PATCH] use secrets from env var --- cmd/config.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/config.go b/cmd/config.go index 1207632..5acb328 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -44,6 +44,14 @@ func LoadConfig(configPath string) (Config, error) { config.ServerEndpoint = "ws://localhost:3400/subscribe" } + if os.Getenv("GITHUB_WEBHOOK_SECRET") != "" { + config.GithubSecret = os.Getenv("GITHUB_WEBHOOK_SECRET") + } + + if os.Getenv("SUBSCRIBE_SECRET") != "" { + config.SubscribeSecret = os.Getenv("SUBSCRIBE_SECRET") + } + validate := validator.New(validator.WithRequiredStructEnabled()) if err := validate.Struct(config); err != nil {