fixed 流水线禁用状态
This commit is contained in:
parent
b4fd3b851e
commit
19783ac526
|
@ -179,6 +179,8 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@pipeline = Action::Pipeline.find_by(id: params[:id])
|
@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?
|
# @pipeline = Action::Pipeline.new(id: 0, pipeline_name: "test-ss", yaml: build_test_yaml) if @pipeline.blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
json.status 0
|
json.status 0
|
||||||
json.message "success"
|
json.message "success"
|
||||||
json.extract! @pipeline, :id, :pipeline_name, :pipeline_status, :description, :file_name, :is_graphic_design, :pipeline_type,
|
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/", ""))
|
Loading…
Reference in New Issue