audit(github): also need to consider commit artifact

Signed-off-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
Rui Chen 2023-10-22 18:09:03 -04:00
parent a496f6708e
commit b954e20d12
No known key found for this signature in database
GPG Key ID: 6577287BDCA70840

View File

@ -217,7 +217,7 @@ module RuboCop
problem "Use /archive/ URLs for GitHub tarballs (url is #{url})." problem "Use /archive/ URLs for GitHub tarballs (url is #{url})."
end end
archive_ref_tags_gh_pattern = %r{https://.*github.*/archive(?!/refs/tags)/.*\.tar\.gz$} archive_ref_tags_gh_pattern = %r{https://.*github.*/archive/(?![a-fA-F0-9]{40})(?!refs/tags/).*\.tar\.gz$}
audit_urls(urls, archive_ref_tags_gh_pattern) do |_, url| audit_urls(urls, archive_ref_tags_gh_pattern) do |_, url|
next if url.end_with?(".git") next if url.end_with?(".git")