mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 05:04:22 +01:00
Merge pull request #152 from camaya/fix-github-pr-nilcheck
Fix Github PR checks error
This commit is contained in:
2 files changed
+13
No files matched your search
@@ -51,6 +51,10 @@ func auditGithubPR() ([]Leak, error) {
|
|||||||
}
|
}
|
||||||
files := commit.Files
|
files := commit.Files
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
|
if f.Patch == nil || f.Filename == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
diff := gitDiff{
|
diff := gitDiff{
|
||||||
sha: commit.GetSHA(),
|
sha: commit.GetSHA(),
|
||||||
content: *f.Patch,
|
content: *f.Patch,
|
||||||
|
|||||||
@@ -311,6 +311,15 @@ func TestRun(t *testing.T) {
|
|||||||
regexp.MustCompile("main.go"),
|
regexp.MustCompile("main.go"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
testOpts: Options{
|
||||||
|
GithubPR: "https://github.com/gitleakstest/gronit/pull/2",
|
||||||
|
},
|
||||||
|
description: "test github pr with commits without patch info",
|
||||||
|
numLeaks: 0,
|
||||||
|
expectedErrMsg: "",
|
||||||
|
commitPerPage: 1,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
g := goblin.Goblin(t)
|
g := goblin.Goblin(t)
|
||||||
for _, test := range tests {
|
for _, test := range tests {
|
||||||
|
|||||||
Reference in new issue
Block a user