Skip to content

Commit

Permalink
Remove superfluous check for pull request
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
oliverguenther committed Feb 19, 2021
1 parent 9acd19d commit 5db2af7
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions script/github_pr_errors
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,7 @@ rescue => e
warn "Failed to perform API request #{url}: #{e} #{e.message}"
end

response = get_http "pulls?state=open&head=opf:#{branch_name}"
raise "No PR found" if response.empty?
raise "More than one PR found??" if response.count > 1

pr_number = response.first['number']

warn "Looking for PR #{pr_number}"
warn "Looking for the last action in branch #{branch_name}"

response = get_http "actions/runs?branch=#{CGI.escape(branch_name)}"

Expand All @@ -53,7 +47,7 @@ last_test_action =
.select { |entry| entry['name'] == 'Core/Test' }
.max_by { |entry| entry['run_number'] }

raise "No action run found for PR #{pr_number}" unless last_test_action
raise "No action run found for branch #{branch_name}" unless last_test_action
log_response = get_http last_test_action['logs_url'], json: false
errors = []

Expand Down

0 comments on commit 5db2af7

Please sign in to comment.