audit whether GitHub prerelease ot not

This commit is contained in:
hyuraku 2020-03-28 16:57:47 +09:00
parent 87fcba5d02
commit 6f622cd525

View File

@ -795,6 +795,12 @@ module Homebrew
return if stable_url_minor_version.even? return if stable_url_minor_version.even?
problem "#{stable.version} is a development release" problem "#{stable.version} is a development release"
when %r{^https://github.com/}
_, owner = URI.parse(stable.url).path.split("/")
tag = stable.specs[:tag] || stable.version.to_s
if GitHub.open_api("#{GitHub::API_URL}/repos/#{owner}/#{stable.full_name}/releases/tags/#{tag}")["prerelease"]
problem "#{tag} is a GitHub prerelease"
end
end end
end end