Skip to content

Commit

Permalink
update prerelease check to allow standard release
Browse files Browse the repository at this point in the history
  • Loading branch information
daeho-ro committed Dec 25, 2024
1 parent ce25ac7 commit af6540b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Library/Homebrew/utils/shared_audits.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit af6540b

Please sign in to comment.