mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 04:04:25 +01:00
Files at commit allow list bug (#485)
* fix allowlist bug * Adding new repo for testing allowlisting * Adding missing allowlist checks for commits and files/paths
This commit is contained in:
1 parent
86cfe0848b
commit
2d58f1f94e
4 files changed
+48
No files matched your search
@@ -42,6 +42,11 @@ func (cs *CommitScanner) SetRepoName(repoName string) {
|
||||
// Scan kicks off a CommitScanner Scan
|
||||
func (cs *CommitScanner) Scan() (Report, error) {
|
||||
var scannerReport Report
|
||||
|
||||
if cs.cfg.Allowlist.CommitAllowed(cs.commit.Hash.String()) {
|
||||
return scannerReport, nil
|
||||
}
|
||||
|
||||
if len(cs.commit.ParentHashes) == 0 {
|
||||
facScanner := NewFilesAtCommitScanner(cs.opts, cs.cfg, cs.repo, cs.commit)
|
||||
return facScanner.Scan()
|
||||
|
||||
Reference in new issue
Block a user