diff --git a/app/controllers/api/v1/projects/pipelines_controller.rb b/app/controllers/api/v1/projects/pipelines_controller.rb index dfd54308b..893003b10 100644 --- a/app/controllers/api/v1/projects/pipelines_controller.rb +++ b/app/controllers/api/v1/projects/pipelines_controller.rb @@ -115,10 +115,10 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController @pipeline.pipeline_name = params[:pipeline_name] if params[:pipeline_name].present? pipeline_yaml = params[:pipeline_yaml].present? ? params[:pipeline_yaml] : build_pipeline_yaml_new(@pipeline.pipeline_name, params[:pipeline_json]) tip_exception("流水线yaml内空不能为空") if pipeline_yaml.blank? - result = validate_string(pipeline_yaml, @pipeline.branch, @project.default_branch) - unless result[:valid] - tip_exception(result[:errors].join(",")) - end + # result = validate_string(pipeline_yaml, @pipeline.branch, @project.default_branch) + # unless result[:valid] + # tip_exception(result[:errors].join(",")) + # end @pipeline.yaml = pipeline_yaml #Rails.logger.info "pipeline_yaml base64=========================#{Base64.encode64(@pipeline.yaml).gsub(/\n/, '')}" sha = get_pipeline_file_sha(@pipeline.file_name, @pipeline.branch) diff --git a/app/controllers/concerns/api/action_validator_helper.rb b/app/controllers/concerns/api/action_validator_helper.rb index f0e7ae752..a4332c249 100644 --- a/app/controllers/concerns/api/action_validator_helper.rb +++ b/app/controllers/concerns/api/action_validator_helper.rb @@ -74,13 +74,13 @@ module Api::ActionValidatorHelper Rails.logger.info "data==true#{data[true]}" if data[true] if data[true]['push'] - unless data[true]['push'].key?('branches') - errors << "push触发器缺少branches配置" - end - - unless data[true]['push'].key?('paths-ignore') - errors << "push触发器缺少paths-ignore配置" - end + # unless data[true]['push'].key?('branches') + # errors << "push触发器缺少branches配置" + # end + # + # unless data[true]['push'].key?('paths-ignore') + # errors << "push触发器缺少paths-ignore配置" + # end end if data[true]['schedule'] && branch != default_branch errors << "只有#{default_branch}分支支持定时触发器"