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:
Zachary Rice authored and GitHub committed 2020-12-09 15:55:01 -05:00
1 parent 86cfe0848b
commit 2d58f1f94e
4 files changed
+48

No files matched your search

+5
View File
@@ -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()