Merge pull request #8623 from reitermarkus/audit-github-forks

Add `GITHUB_FORK_ALLOWLIST`.
This commit is contained in:
Markus Reiter 2020-09-05 20:27:11 +02:00 committed by GitHub
commit a879e8c362
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,12 +96,19 @@ module SharedAudits
"#{tag} is a GitLab pre-release."
end
GITHUB_FORK_ALLOWLIST = %w[
variar/klogg
].freeze
def github(user, repo)
metadata = github_repo_data(user, repo)
return if metadata.nil?
return "GitHub fork (not canonical repository)" if metadata["fork"]
if metadata["fork"] && !GITHUB_FORK_ALLOWLIST.include?("#{user}/#{repo}")
return "GitHub fork (not canonical repository)"
end
if (metadata["forks_count"] < 30) && (metadata["subscribers_count"] < 30) &&
(metadata["stargazers_count"] < 75)
return "GitHub repository not notable enough (<30 forks, <30 watchers and <75 stars)"