Skip to content

Commit

Permalink
Do not fail github_pr_errors if PR is closed or merged
Browse files Browse the repository at this point in the history
  • Loading branch information
cbliard committed Sep 25, 2023
1 parent 41f8bea commit c46e674
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions script/github_pr_errors
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,14 @@ class Formatter
def display_pull_request_info(workflow_run)
return unless workflow_run['event'] == 'pull_request'

pr = workflow_run['pull_requests'].first or
raise "Pull Request info cannot be found, perhaps it is already merged or closed?"
pr_number = "##{pr['number']}"
pr_html_url = "#{GITHUB_HTML_OPENPROJECT_PREFIX}/pull/#{pr['number']}"
pr_display_title = "#{workflow_run['display_title']} #{pr_number.white.dark} #{pr_html_url.white.dark}"
warn " Pull Request: #{pr_display_title} "
if pr = workflow_run['pull_requests'].first
pr_number = "##{pr['number']}"
pr_html_url = "#{GITHUB_HTML_OPENPROJECT_PREFIX}/pull/#{pr['number']}"
pr_display_title = "#{workflow_run['display_title']} #{pr_number.white.dark} #{pr_html_url.white.dark}"
warn " Pull Request: #{pr_display_title} "
else
warn " Pull Request: not found; perhaps it is already merged or closed?"
end
end

def commit_message(workflow_run)
Expand Down

0 comments on commit c46e674

Please sign in to comment.