bump-formula-pr: improve duplicate detection

Reduce the chance of false flagging by making sure that the existing pr
surfaced by GitHub.issues_for_formula actually contains the exact formula name
in its title.
This commit is contained in:
Zhiming Wang 2017-02-18 10:16:59 -05:00
parent 61a41d0da6
commit 81a7609213
No known key found for this signature in database
GPG Key ID: 5B58F95EC95965D8

View File

@ -80,7 +80,8 @@ module Homebrew
def fetch_pull_requests(formula)
GitHub.issues_for_formula(formula.name, tap: formula.tap).select do |pr|
pr["html_url"].include?("/pull/")
pr["html_url"].include?("/pull/") &&
/(^|\s)#{Regexp.quote(formula.name)}(:|\s|$)/i =~ pr["title"]
end
rescue GitHub::RateLimitExceededError => e
opoo e.message