mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 20:24:22 +01:00
24 lines
536 B
Go
24 lines
536 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
"github.com/zricethezav/gitleaks/src"
|
|
)
|
|
|
|
func main() {
|
|
report, err := gitleaks.Run(gitleaks.ParseOpts())
|
|
if err != nil {
|
|
log.Error(err)
|
|
os.Exit(gitleaks.ErrExit)
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|