formula_auditor: also use tag when checking GitHub license

Signed-off-by: Michael Cho <michael@michaelcho.dev>
This commit is contained in:
Michael Cho 2024-03-04 11:56:19 -05:00
parent 8d4e841965
commit 00a12b72d4
No known key found for this signature in database
GPG Key ID: 55E85E28A7CD1E85

View File

@ -242,6 +242,7 @@ module Homebrew
return if user.blank? return if user.blank?
tag = SharedAudits.github_tag_from_url(formula.stable.url) tag = SharedAudits.github_tag_from_url(formula.stable.url)
tag ||= formula.stable.specs[:tag]
github_license = GitHub.get_repo_license(user, repo, ref: tag) github_license = GitHub.get_repo_license(user, repo, ref: tag)
return unless github_license return unless github_license
return if (licenses + ["NOASSERTION"]).include?(github_license) return if (licenses + ["NOASSERTION"]).include?(github_license)