mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 04:34:46 +01:00
making good progress on tests
This commit is contained in:
1 parent
ae4542abf0
commit
4ea0c66bec
4 files changed
+149
-129
No files matched your search
@@ -1,7 +1,22 @@
|
||||
package main
|
||||
|
||||
import "github.com/zricethezav/gitleaks/src"
|
||||
import (
|
||||
"os"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/zricethezav/gitleaks/src"
|
||||
)
|
||||
|
||||
func main() {
|
||||
gitleaks.Run(gitleaks.ParseOpts())
|
||||
report, err := gitleaks.Run(gitleaks.ParseOpts())
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
if len(report.Leaks) != 0 {
|
||||
log.Warnf("%d leaks detected. %d commits inspected in %s", len(report.Leaks), report.Commits, report.Duration)
|
||||
os.Exit(gitleaks.LeakExit)
|
||||
} else {
|
||||
log.Infof("%d leaks detected. %d commits inspected in %s", len(report.Leaks), report.Commits, report.Duration)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user