mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 20:54:22 +01:00
Config min version (#1955)
* init * minVersion set * sigh * addressed some comments, fixed double validate bug
This commit is contained in:
1 parent
d22371873b
commit
3821f30b06
9 files changed
+84
-6
No files matched your search
@@ -13,6 +13,11 @@
|
||||
|
||||
title = "{{.Title}}"
|
||||
|
||||
# minVersion indicates the minimum Gitleaks version required to use this config.
|
||||
# If the running version is older, a warning will be logged and not all
|
||||
# config-enabled features are guaranteed to work.
|
||||
minVersion = "v8.25.0"
|
||||
|
||||
{{ with .Allowlists }}{{ range $i, $allowlist := . }}{{ if or $allowlist.Regexes $allowlist.Paths $allowlist.Commits $allowlist.StopWords }}# TODO: change to [[allowlists]]{{println}}[allowlist]
|
||||
{{- with .Description }}{{println}}description = "{{ . }}"{{ end }}
|
||||
{{- with .MatchCondition }}{{println}}condition = "{{ .String }}"{{ end }}
|
||||
|
||||
+2
-1
@@ -19,6 +19,7 @@ import (
|
||||
"github.com/zricethezav/gitleaks/v8/logging"
|
||||
"github.com/zricethezav/gitleaks/v8/regexp"
|
||||
"github.com/zricethezav/gitleaks/v8/report"
|
||||
"github.com/zricethezav/gitleaks/v8/version"
|
||||
)
|
||||
|
||||
const banner = `
|
||||
@@ -42,7 +43,7 @@ var (
|
||||
rootCmd = &cobra.Command{
|
||||
Use: "gitleaks",
|
||||
Short: "Gitleaks scans code, past or present, for secrets",
|
||||
Version: Version,
|
||||
Version: version.Version,
|
||||
}
|
||||
|
||||
// diagnostics manager is global to ensure it can be started before a scan begins
|
||||
|
||||
+2
-3
@@ -4,10 +4,9 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/zricethezav/gitleaks/v8/version"
|
||||
)
|
||||
|
||||
var Version = "version is set by build process"
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(versionCmd)
|
||||
}
|
||||
@@ -19,5 +18,5 @@ var versionCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
func runVersion(cmd *cobra.Command, args []string) {
|
||||
fmt.Println(Version)
|
||||
fmt.Println(version.Version)
|
||||
}
|
||||
Reference in new issue
Block a user