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,15 +97,17 @@ module WorkflowReport ...@@ -97,15 +97,17 @@ 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
begin
jp_request_arr = URI(jp_request).path.split('/').reject(&:blank?) jp_request_arr = URI(jp_request).path.split('/').reject(&:blank?)
if jp_request_arr.length == 4 && jp_request_arr[3].to_i.positive? if jp_request_arr.length == 4 && jp_request_arr[3].to_i.positive?
begin
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 : '')
end
rescue => e rescue => e
p "Error in ISSUE link #{jp_request}"
result[33].push('') result[33].push('')
end end
end
else else
result[32] << '' result[32] << ''
result[33] << '' result[33] << ''
......
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