Skip to content

Commit

Permalink
use secrets from env var
Browse files Browse the repository at this point in the history
  • Loading branch information
nikmel2803 committed Sep 23, 2023
1 parent a96b265 commit 20b6844
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 20b6844

Please sign in to comment.