Raise an error in the github pr errors script when the PR cannot be found on the workflow, this happens when a PR is closed or merged

This commit is contained in:
Dombi Attila
2023-02-07 12:13:58 +02:00
committed by Oliver Günther
parent eb0dae09a2
commit 4bf9f53802
+2 -1
View File
@@ -206,7 +206,8 @@ end
def display_pull_request_info(workflow_run)
return unless workflow_run['event'] == 'pull_request'
pr = workflow_run['pull_requests'].first
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}"