Merge pull request #152 from camaya/fix-github-pr-nilcheck

Fix Github PR checks error
This commit is contained in:
Zachary Rice authored and GitHub committed 2018-11-29 09:10:36 -06:00
commit 342e9f80db
2 files changed
+13

No files matched your search

+4
View File
@@ -51,6 +51,10 @@ func auditGithubPR() ([]Leak, error) {
}
files := commit.Files
for _, f := range files {
if f.Patch == nil || f.Filename == nil {
continue
}
diff := gitDiff{
sha: commit.GetSHA(),
content: *f.Patch,
+9
View File
@@ -311,6 +311,15 @@ func TestRun(t *testing.T) {
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)
for _, test := range tests {