mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-27 11:44:23 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ba97d0fa3 |
No files matched your search
@@ -1,6 +1,10 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
1.7.1
|
||||
-----
|
||||
- Fixing bug where single repos were not being audited
|
||||
|
||||
1.7.0
|
||||
-----
|
||||
- Exit code == 2 on error
|
||||
|
||||
@@ -239,6 +239,30 @@ func TestRunAudit(t *testing.T) {
|
||||
numLeaks: 0,
|
||||
expectedErrMsg: "unable to generate ssh key: open reallyreallyreallyreallywrongpath: no such file or directory",
|
||||
},
|
||||
{
|
||||
testOpts: Options{
|
||||
Repo: "https://github.com/gitleakstest/gronit.git",
|
||||
},
|
||||
description: "test leak",
|
||||
numLeaks: 2,
|
||||
expectedErrMsg: "",
|
||||
},
|
||||
{
|
||||
testOpts: Options{
|
||||
Repo: "https://github.com/gitleakstest/h1domains.git",
|
||||
},
|
||||
description: "test clean",
|
||||
numLeaks: 0,
|
||||
expectedErrMsg: "",
|
||||
},
|
||||
{
|
||||
testOpts: Options{
|
||||
Repo: "https://github.com/gitleakstest/empty.git",
|
||||
},
|
||||
description: "test empty",
|
||||
numLeaks: 0,
|
||||
expectedErrMsg: "reference not found",
|
||||
},
|
||||
}
|
||||
g := goblin.Goblin(t)
|
||||
for _, test := range tests {
|
||||
|
||||
@@ -119,7 +119,7 @@ type Config struct {
|
||||
}
|
||||
|
||||
const defaultGithubURL = "https://api.github.com/"
|
||||
const version = "1.7.0"
|
||||
const version = "1.7.1"
|
||||
const errExit = 2
|
||||
const leakExit = 1
|
||||
const defaultConfig = `
|
||||
@@ -194,10 +194,6 @@ func main() {
|
||||
fmt.Println(version)
|
||||
os.Exit(0)
|
||||
}
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
os.Exit(errExit)
|
||||
}
|
||||
leaks, err := run()
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
@@ -245,7 +241,13 @@ func run() ([]Leak, error) {
|
||||
func startAudits() ([]Leak, error) {
|
||||
var leaks []Leak
|
||||
// start audits
|
||||
if opts.OwnerPath != "" {
|
||||
if opts.Repo != "" || opts.RepoPath != "" {
|
||||
repo, err := getRepo()
|
||||
if err != nil {
|
||||
return leaks, err
|
||||
}
|
||||
return auditRepo(repo)
|
||||
} else if opts.OwnerPath != "" {
|
||||
repos, err := discoverRepos(opts.OwnerPath)
|
||||
if err != nil {
|
||||
return leaks, err
|
||||
|
||||
Reference in new issue
Block a user