From a53f2e0eb9fea95e3cf46974b7e0ab5bb6c99049 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Mon, 21 Apr 2025 15:13:17 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E7=BB=84=E7=BB=87=E6=B5=81=E6=B0=B4?= =?UTF-8?q?=E7=BA=BF=E4=B8=AD=E5=A4=9A=E4=BB=93=E5=BA=93=E9=9A=94=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/pm/pipelines_controller.rb | 3 ++- app/views/api/pm/pipelines/index.json.jbuilder | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/pm/pipelines_controller.rb b/app/controllers/api/pm/pipelines_controller.rb index c1dd3411a..ac04a41ce 100644 --- a/app/controllers/api/pm/pipelines_controller.rb +++ b/app/controllers/api/pm/pipelines_controller.rb @@ -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 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? ? { id: last_action_run.id, 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 end @run_result << { + repo_id: last_action_run.repo_id, filename: ".gitea/workflows/#{file}", total: total, success: success, diff --git a/app/views/api/pm/pipelines/index.json.jbuilder b/app/views/api/pm/pipelines/index.json.jbuilder index f13d013da..126adc477 100644 --- a/app/views/api/pm/pipelines/index.json.jbuilder +++ b/app/views/api/pm/pipelines/index.json.jbuilder @@ -19,7 +19,7 @@ json.projects @pipelines.map(&:project_id).uniq.each do |project_id| json.disable pipeline.disable end 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