From d50e872fd8506a69b0a171c2a2be78c711877bd6 Mon Sep 17 00:00:00 2001 From: Daeho Ro Date: Wed, 25 Dec 2024 18:53:28 +0900 Subject: [PATCH] update prerelease check to allow standard release --- Library/Homebrew/utils/shared_audits.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/utils/shared_audits.rb b/Library/Homebrew/utils/shared_audits.rb index ba479d8241c3a..3957c3d76420a 100644 --- a/Library/Homebrew/utils/shared_audits.rb +++ b/Library/Homebrew/utils/shared_audits.rb @@ -56,13 +56,17 @@ def self.github_release(user, repo, tag, formula: nil, cask: nil) release = github_release_data(user, repo, tag) return unless release - exception, version = if formula - [formula.tap&.audit_exception(:github_prerelease_allowlist, formula.name), formula.version] + exception, name, version = if formula + [formula.tap&.audit_exception(:github_prerelease_allowlist, formula.name), formula.name, formula.version] elsif cask - [cask.tap&.audit_exception(:github_prerelease_allowlist, cask.token), cask.version] + [cask.tap&.audit_exception(:github_prerelease_allowlist, cask.token), cask.token, cask.version] end - return "#{tag} is a GitHub pre-release." if release["prerelease"] && [version, "all"].exclude?(exception) + return "#{tag} is a GitHub pre-release." if release["prerelease"] && [version, "all", "any"].exclude?(exception) + + if !release["prerelease"] && [version, "any"].exclude?(exception) + return "#{tag} is not a GitHub pre-release but '#{name}' is in the GitHub prerelease allowlist." + end "#{tag} is a GitHub draft." if release["draft"] end