mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
Global allowlist regex (#422)
* work in progress * Update test configs * adding test * golint and change to allowlist * fix race condition, this mistakenly got committed * Updating tests and examples * bump to v6 as this is a breaking change to the config * More consistent variables
This commit is contained in:
1 parent
6129b1a15d
commit
fae366a404
69 files changed
+449
-204
No files matched your search
+5
-5
@@ -11,8 +11,8 @@ import (
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"github.com/zricethezav/gitleaks/v5/config"
|
||||
"github.com/zricethezav/gitleaks/v5/manager"
|
||||
"github.com/zricethezav/gitleaks/v6/config"
|
||||
"github.com/zricethezav/gitleaks/v6/manager"
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
"github.com/go-git/go-billy/v5"
|
||||
@@ -77,11 +77,11 @@ func Run(m *manager.Manager) error {
|
||||
|
||||
func runHelper(r *Repo) error {
|
||||
// Ignore allowlisted repos
|
||||
for _, wlRepo := range r.Manager.Config.Allowlist.Repos {
|
||||
if RegexMatched(r.Manager.Opts.RepoPath, wlRepo) {
|
||||
for _, allowListedRepo := range r.Manager.Config.Allowlist.Repos {
|
||||
if RegexMatched(r.Manager.Opts.RepoPath, allowListedRepo) {
|
||||
return nil
|
||||
}
|
||||
if RegexMatched(r.Manager.Opts.Repo, wlRepo) {
|
||||
if RegexMatched(r.Manager.Opts.Repo, allowListedRepo) {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user