audit: handle some GitHub repo audit edge cases.
This commit is contained in:
parent
51a1792e7a
commit
c0c68b2b3f
@ -430,7 +430,14 @@ class FormulaAuditor
|
|||||||
_, user, repo = *regex.match(formula.homepage) unless user
|
_, user, repo = *regex.match(formula.homepage) unless user
|
||||||
return if !user || !repo
|
return if !user || !repo
|
||||||
|
|
||||||
metadata = GitHub.repository(user, repo)
|
repo.gsub!(/.git$/, "")
|
||||||
|
|
||||||
|
begin
|
||||||
|
metadata = GitHub.repository(user, repo)
|
||||||
|
rescue GitHub::HTTPNotFoundError => e
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
problem "GitHub fork (not canonical repository)" if metadata["fork"]
|
problem "GitHub fork (not canonical repository)" if metadata["fork"]
|
||||||
if (metadata["forks_count"] < 5) || (metadata["watchers_count"] < 5) ||
|
if (metadata["forks_count"] < 5) || (metadata["watchers_count"] < 5) ||
|
||||||
(metadata["stargazers_count"] < 10)
|
(metadata["stargazers_count"] < 10)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user