fixed 组织流水线中多仓库隔离
This commit is contained in:
parent
3594462917
commit
a53f2e0eb9
|
@ -35,7 +35,7 @@ class Api::Pm::PipelinesController < Api::Pm::BaseController
|
||||||
# 导入的流水线统一先禁用
|
# 导入的流水线统一先禁用
|
||||||
$gitea_hat_client.post_repos_actions_disable(project&.owner&.login, project&.identifier, {query: {workflow: file}}) rescue nil
|
$gitea_hat_client.post_repos_actions_disable(project&.owner&.login, project&.identifier, {query: {workflow: file}}) rescue nil
|
||||||
end
|
end
|
||||||
last_action_run = action_runs.where(workflow_id: file).order(updated: :desc).first
|
last_action_run = action_runs.where(repo_id: project.gpid).where(workflow_id: file).order(updated: :desc).first
|
||||||
last_action_run_json = last_action_run.present? ? {
|
last_action_run_json = last_action_run.present? ? {
|
||||||
id: last_action_run.id,
|
id: last_action_run.id,
|
||||||
schedule: last_action_run.schedule_id > 0,
|
schedule: last_action_run.schedule_id > 0,
|
||||||
|
@ -58,6 +58,7 @@ class Api::Pm::PipelinesController < Api::Pm::BaseController
|
||||||
failure += v if k[0] == file && k[1] == 2
|
failure += v if k[0] == file && k[1] == 2
|
||||||
end
|
end
|
||||||
@run_result << {
|
@run_result << {
|
||||||
|
repo_id: last_action_run.repo_id,
|
||||||
filename: ".gitea/workflows/#{file}",
|
filename: ".gitea/workflows/#{file}",
|
||||||
total: total,
|
total: total,
|
||||||
success: success,
|
success: success,
|
||||||
|
|
|
@ -19,7 +19,7 @@ json.projects @pipelines.map(&:project_id).uniq.each do |project_id|
|
||||||
json.disable pipeline.disable
|
json.disable pipeline.disable
|
||||||
end
|
end
|
||||||
json.pipeline_type pipeline.pipeline_type
|
json.pipeline_type pipeline.pipeline_type
|
||||||
json.run_data @run_result.select { |result| result[:filename] == pipeline.file_name }.first
|
json.run_data @run_result.select { |result| result[:repo_id] == project.gpid && result[:filename] == pipeline.file_name}.first
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue