From af6540b8316300943b5873f1a786fd2ab93fbd98 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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/utils/shared_audits.rb b/Library/Homebrew/utils/shared_audits.rb index ba479d8241c3a..236e766e71579 100644 --- a/Library/Homebrew/utils/shared_audits.rb +++ b/Library/Homebrew/utils/shared_audits.rb @@ -56,14 +56,18 @@ 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) + if !release["prerelease"] && [version, "fast-forward"].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