def find_pull_request(base, head, error_if_missing = false)
      logger.info { "Looking for a pull request asking for '#{head}' to be merged into '#{base}' on #{repo}." }

      json = pull_requests
      pr = json.find do |p|
        p[:head][:ref] == head and p[:base][:ref] == base
      end

      raise NotFoundError.new(base, head, repo, json) if error_if_missing && pr.nil?

      pr
    end
def find_pull_request(base, head, error_if_missing = false)
      logger.info { "Looking for a pull request asking for '#{head}' to be merged into '#{base}' on #{repo}." }

      json = pull_requests
      pr = json.find do |p|
        p[:head][:ref] == head and p[:base][:ref] == base
      end

      raise NotFoundError.new(base, head, repo, json) if error_if_missing && pr.nil?

      pr
    end
Find the pull request (PR) that matches the 'head' and 'base'.

 @param [String] base what the PR is merging into
 @param [String] head the branch of the PR
 @param [boolean] error_if_missing should this error-out if the PR is not found?

 @return [Hash, nil]
 @raise [NotFoundError] if the pull request does not exist and 'error_if_missing' is true