mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-28 04:04:25 +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
|
||||
for _, f := range files {
|
||||
if f.Patch == nil || f.Filename == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
diff := gitDiff{
|
||||
sha: commit.GetSHA(),
|
||||
content: *f.Patch,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user