chore: tweak logging and readme for GITLEAKS_CONFIG_TOML feature (#1802)

This commit is contained in:
Richard Gomez authored and GitHub committed 2025-03-22 13:03:09 -05:00
1 parent a503b583ba
commit e273a970a4
2 files changed
+19 -19

No files matched your search

+2 -2
View File
@@ -131,9 +131,9 @@ func initConfig(source string) {
} else if os.Getenv("GITLEAKS_CONFIG_TOML") != "" {
configContent := []byte(os.Getenv("GITLEAKS_CONFIG_TOML"))
if err := viper.ReadConfig(bytes.NewBuffer(configContent)); err != nil {
logging.Fatal().Msgf("unable to load gitleaks config from GITLEAKS_CONFIG_TOML env var content(%s), err: %s", configContent, err)
logging.Fatal().Err(err).Str("content", os.Getenv("GITLEAKS_CONFIG_TOML")).Msg("unable to load gitleaks config from GITLEAKS_CONFIG_TOML env var")
}
logging.Debug().Msgf("using gitleaks config from GITLEAKS_CONFIG_TOML env var content: %s", configContent)
logging.Debug().Str("content", os.Getenv("GITLEAKS_CONFIG_TOML")).Msg("using gitleaks config from GITLEAKS_CONFIG_TOML env var content")
return
} else {
fileInfo, err := os.Stat(source)