app/models/changeset.rb
# github only supports finding open PRs for branches (not commits or tags)
# https://help.github.com/en/articles/searching-issues-and-pull-requests
#
# List response is not the same as the show response (missing commits/additions/etc), do not use PullRequest.new
#
# @return [Array<Integer>]


List response is not the same as the show response (missing commits/additions/etc), do not use PullRequest.new
List response is not the same as the show response ( missing commits / additions / etc ) do not use PullRequest . new
def open_pull_requests
    return [] if static? || MAIN_BRANCHES.include?(@reference)
    org = @repo.split("/", 2).first
    GITHUB.pull_requests(@repo, head: "#{org}:#{@reference}").map(&:number)
  rescue Octokit::Error, Faraday::ConnectionFailed => e
    Rails.logger.warn "Failed fetching pull requests for branch #{@reference}:\n#{e}"
    []
  end
def open_pull_requests return [ ] if static? || MAIN_BRANCHES . include? ( @reference ) org = @repo . split ( "/" , 2 ) . first GITHUB . pull_requests ( @repo , head : "#{org}:#{@reference}" ) . map ( & :number ) rescue Octokit :: Error , Faraday :: ConnectionFailed => e Rails . logger . warn "Failed fetching pull requests for branch #{@reference}:\n#{e}" [ ] end
github only supports finding open PRs for branches (not commits or tags)
https://help.github.com/en/articles/searching-issues-and-pull-requests
github only supports finding open PRs for branches ( not commits or tags ) https : // help . github . com / en / articles / searching - issues - and - pull - requests
None
Array<Integer>