adding logic to ignore gitleaks config during scans (#710)

This commit is contained in:
Zachary Rice authored and GitHub committed 2021-11-24 20:27:19 -06:00
1 parent a37822dffd
commit 4acd7a3c8d
6 files changed
+22 -3

No files matched your search

+2 -2
View File
@@ -19,8 +19,8 @@ func DetectFindings(cfg config.Config, b []byte, filePath string, commit string)
var findings []report.Finding
linePairs := regexp.MustCompile("\n").FindAllIndex(b, -1)
// check if we should skip file based on the global allowlist
if cfg.Allowlist.PathAllowed(filePath) {
// check if we should skip file based on the global allowlist or if the file is the same as the gitleaks config
if cfg.Allowlist.PathAllowed(filePath) || filePath == cfg.Path {
return findings
}