From 19783ac526705d2912d199d837a910a53fbbd13c Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 9 Apr 2025 15:03:14 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E6=B5=81=E6=B0=B4=E7=BA=BF=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/projects/pipelines_controller.rb | 2 ++ app/views/api/v1/projects/pipelines/show.json.jbuilder | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v1/projects/pipelines_controller.rb b/app/controllers/api/v1/projects/pipelines_controller.rb index a428c4e03..915962e48 100644 --- a/app/controllers/api/v1/projects/pipelines_controller.rb +++ b/app/controllers/api/v1/projects/pipelines_controller.rb @@ -179,6 +179,8 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController def show @pipeline = Action::Pipeline.find_by(id: params[:id]) + disabled_config = Gitea::RepoUnit.where(repo_id: @project.gpid, type: 10)&.first&.config + @disabled_workflows = disabled_config.present? ? JSON.parse(disabled_config)["DisabledWorkflows"] : [] # @pipeline = Action::Pipeline.new(id: 0, pipeline_name: "test-ss", yaml: build_test_yaml) if @pipeline.blank? end diff --git a/app/views/api/v1/projects/pipelines/show.json.jbuilder b/app/views/api/v1/projects/pipelines/show.json.jbuilder index 996bd0556..b16932ba0 100644 --- a/app/views/api/v1/projects/pipelines/show.json.jbuilder +++ b/app/views/api/v1/projects/pipelines/show.json.jbuilder @@ -1,4 +1,5 @@ json.status 0 json.message "success" json.extract! @pipeline, :id, :pipeline_name, :pipeline_status, :description, :file_name, :is_graphic_design, :pipeline_type, - :repo_name, :repo_identifier, :branch, :event, :sha, :disable, :json, :yaml, :created_at, :updated_at + :repo_name, :repo_identifier, :branch, :event, :sha, :json, :yaml, :created_at, :updated_at +json.disable @disabled_workflows.include?(pipeline.file_name.to_s.gsub(".gitea/workflows/", "")) \ No newline at end of file