From 1c10f51f9855076b541001b4b033800977d31a7b Mon Sep 17 00:00:00 2001 From: Dustin Rodrigues Date: Wed, 12 Aug 2020 10:31:59 -0400 Subject: [PATCH] audit: check GitHub tags for prerelease status --- Library/Homebrew/dev-cmd/audit.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index c8cf5f8039..605c3f4ac3 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -781,7 +781,7 @@ module Homebrew return if stable_url_minor_version.even? problem "#{stable.version} is a development release" - when %r{^https://github.com/([\w-]+)/([\w-]+)/} + when %r{^https://github.com/([\w-]+)/([\w-]+)} owner = Regexp.last_match(1) repo = Regexp.last_match(2) tag = url.match(%r{^https://github\.com/[\w-]+/[\w-]+/archive/([^/]+)\.(tar\.gz|zip)$}) @@ -790,6 +790,7 @@ module Homebrew tag ||= url.match(%r{^https://github\.com/[\w-]+/[\w-]+/releases/download/([^/]+)/}) .to_a .second + tag ||= formula.stable.specs[:tag] begin if @online && (release = GitHub.open_api("#{GitHub::API_URL}/repos/#{owner}/#{repo}/releases/tags/#{tag}"))