formula_auditor: allow references to closed PRs

The `github_issue_comment` audit disallows references to closed or
merged PRs in other repositories. We should allow those, since it is a
common pattern to reference merged PRs in formulae when adding comments
that explain changes that need to be made in future versions (e.g.
`patch` blocks).
This commit is contained in:
Carlo Cabrera 2023-02-10 22:02:17 +08:00
parent eb7c6ad195
commit ca35e0ff11
No known key found for this signature in database
GPG Key ID: C74D447FC549A1D0

View File

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