修复:流水线文件不存在报错
This commit is contained in:
parent
2d9b97ee78
commit
dd96e1e2da
|
@ -2,11 +2,11 @@ class Api::V1::Projects::Actions::RunsController < Api::V1::Projects::Actions::B
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@result_object = Api::V1::Projects::Actions::Runs::ListService.call(@project, {workflow: params[:workflow], page: page, limit: limit}, current_user&.gitea_token)
|
@result_object = Api::V1::Projects::Actions::Runs::ListService.call(@project, {workflow: params[:workflow], page: page, limit: limit}, current_user&.gitea_token)
|
||||||
|
puts @result_object
|
||||||
end
|
end
|
||||||
|
|
||||||
def job_show
|
def job_show
|
||||||
@result_object = Api::V1::Projects::Actions::Runs::JobShowService.call(@project, params[:run_id], params[:job], params[:log_cursors], current_user&.gitea_token)
|
@result_object = Api::V1::Projects::Actions::Runs::JobShowService.call(@project, params[:run_id], params[:job], params[:log_cursors], current_user&.gitea_token)
|
||||||
puts @result_object
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
|
@ -1,19 +1,23 @@
|
||||||
json.total_data @result_object[:total_data].to_i
|
json.total_data @result_object[:total_data].to_i
|
||||||
json.runs @result_object[:data]["Runs"].each do |run|
|
if @result_object[:data]["Runs"].present?
|
||||||
json.workflow run["WorkflowID"]
|
json.runs @result_object[:data]["Runs"].each do |run|
|
||||||
json.index run["Index"]
|
json.workflow run["WorkflowID"]
|
||||||
json.title run["Title"]
|
json.index run["Index"]
|
||||||
json.trigger_user do
|
json.title run["Title"]
|
||||||
json.partial! 'api/v1/users/commit_user', locals: { user: render_cache_commit_author(run['TriggerUser']), name: run['TriggerUser']['Name'] }
|
json.trigger_user do
|
||||||
end
|
json.partial! 'api/v1/users/commit_user', locals: { user: render_cache_commit_author(run['TriggerUser']), name: run['TriggerUser']['Name'] }
|
||||||
|
end
|
||||||
|
|
||||||
if run["Ref"].starts_with?("refs/tags")
|
if run["Ref"].starts_with?("refs/tags")
|
||||||
json.ref run["Ref"].gsub!("/refs/tags/", "")
|
json.ref run["Ref"].gsub!("/refs/tags/", "")
|
||||||
else
|
else
|
||||||
json.ref run["Ref"].gsub!("refs/heads/", "")
|
json.ref run["Ref"].gsub!("refs/heads/", "")
|
||||||
end
|
end
|
||||||
|
|
||||||
json.status run["Status"]
|
json.status run["Status"]
|
||||||
json.time_ago time_from_now(run["Stopped"])
|
json.time_ago time_from_now(run["Stopped"])
|
||||||
json.holding_time run["Stopped"]-run["Started"]
|
json.holding_time run["Stopped"]-run["Started"]
|
||||||
|
end
|
||||||
|
else
|
||||||
|
json.runs []
|
||||||
end
|
end
|
Loading…
Reference in New Issue