From 62de4a0ac873cee0d350153a3f225bb51d70dff1 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Fri, 31 May 2024 09:24:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=94=E8=B0=83=E5=9B=BE=E5=BD=A2=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=8C=96-=E6=9B=B4=E6=96=B0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8D=E8=BD=ACbase64?= 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/build_pipeline.yaml.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/v1/projects/pipelines_controller.rb b/app/controllers/api/v1/projects/pipelines_controller.rb index ba8634629..ce662f24d 100644 --- a/app/controllers/api/v1/projects/pipelines_controller.rb +++ b/app/controllers/api/v1/projects/pipelines_controller.rb @@ -158,7 +158,7 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController filepath: ".gitea/workflows/#{@pipeline.pipeline_name}.yml", branch: @pipeline.branch, new_branch: @pipeline.branch, - content: Base64.encode64(@pipeline.yaml).gsub(/\n/, ''), + content: opt == "create" ? Base64.encode64(@pipeline.yaml).gsub(/\n/, '') : @pipeline.yaml, message: "#{opt} pipeline", committer: { email: current_user.mail, diff --git a/app/views/api/v1/projects/pipelines/build_pipeline.yaml.erb b/app/views/api/v1/projects/pipelines/build_pipeline.yaml.erb index 149d7a6be..d25705687 100644 --- a/app/views/api/v1/projects/pipelines/build_pipeline.yaml.erb +++ b/app/views/api/v1/projects/pipelines/build_pipeline.yaml.erb @@ -9,10 +9,10 @@ on: <% node.input_values.each_key do |key| %> <%=key %>: <% if node.input_values[key].blank? %> - - * + - * <% else %> <% node.input_values[key].to_s.split(",").each do |val| %> - - <%=val %> + - <%=val %> <% end %> <% end %> <% end %>