Disallow references to PRs that are closed but not merged

This commit is contained in:
Carlo Cabrera 2023-02-15 16:18:48 +08:00
parent ca35e0ff11
commit 72d8a50e7a
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

@ -830,8 +830,8 @@ module Homebrew
issue = GitHub::API.open_rest("https://api.github.com/repos/#{owner}/#{repo}/issues/#{id}")
next if issue.blank?
next if issue["pull_request"].present?
next if issue["state"] == "open"
next if issue.dig("pull_request", "merged_at").present?
issue_url = "https://github.com/#{owner}/#{repo}/#{type}/#{id}"
problem "Formula refers to a GitHub issue or pull request that is closed: #{issue_url}"