From 541815fb03d904010287547e7d91f2e3f71d0f78 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Tue, 28 May 2024 17:31:07 +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-=E8=BF=94=E5=9B=9E=E6=96=87=E4=BB=B6sha?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/projects/pipelines_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/v1/projects/pipelines_controller.rb b/app/controllers/api/v1/projects/pipelines_controller.rb index c2efc36ae..e8a7a1c3b 100644 --- a/app/controllers/api/v1/projects/pipelines_controller.rb +++ b/app/controllers/api/v1/projects/pipelines_controller.rb @@ -35,7 +35,8 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController sha = get_pipeline_file_sha(@pipeline.file_name, @pipeline.branch) interactor = sha.present? ? Gitea::UpdateFileInteractor.call(current_user.gitea_token, @owner.login, content_params("update").merge(sha: sha)) : Gitea::CreateFileInteractor.call(current_user.gitea_token, @owner.login, content_params("create")) tip_exception(interactor.error) unless interactor.success? - render_ok({ pipeline_yaml: pipeline_yaml }) + file = interactor.result + render_ok({ pipeline_yaml: pipeline_yaml, pipeline_name: params[:pipeline_name], file_name: @pipeline.file_name, sha: file['content']['sha'] }) end def build_yaml @@ -61,7 +62,8 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController sha = get_pipeline_file_sha(@pipeline.file_name, @pipeline.branch) interactor = Gitea::UpdateFileInteractor.call(current_user.gitea_token, @owner.login, content_params("create").merge(sha: sha)) tip_exception(interactor.error) unless interactor.success? - render_ok + file = interactor.result + render_ok({ pipeline_yaml: pipeline_yaml, pipeline_name: params[:pipeline_name], file_name: @pipeline.file_name, sha: file['content']['sha'] }) end def destroy