Commit a81ca957 by Tấn Trần Thanh

cover case user not input link to issue

parent 05e089e5
Pipeline #1594 failed with stages
in 0 seconds
...@@ -97,14 +97,16 @@ module WorkflowReport ...@@ -97,14 +97,16 @@ module WorkflowReport
if jp_request.present? if jp_request.present?
jp_request = jp_request.strip jp_request = jp_request.strip
result[32] << jp_request result[32] << jp_request
jp_request_arr = URI(jp_request).path.split('/').reject(&:blank?) begin
if jp_request_arr.length == 4 && jp_request_arr[3].to_i.positive? jp_request_arr = URI(jp_request).path.split('/').reject(&:blank?)
begin if jp_request_arr.length == 4 && jp_request_arr[3].to_i.positive?
issue_detail = github.issues.find user: jp_request_arr[0], repo: jp_request_arr[1], number: jp_request_arr[3] issue_detail = github.issues.find user: jp_request_arr[0], repo: jp_request_arr[1], number: jp_request_arr[3]
result[33].push(issue_detail.success? ? issue_detail.comments : '') result[33].push(issue_detail.success? ? issue_detail.comments : '')
rescue => e
result[33].push('')
end end
rescue => e
p "Error in ISSUE link #{jp_request}"
result[33].push('')
end end
else else
result[32] << '' result[32] << ''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment