From 155fc35cfaf5052cc9ff7fef28a1bad267e894ad Mon Sep 17 00:00:00 2001 From: victor <121183489011@qq.com> Date: Mon, 1 Feb 2021 16:19:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=BB=A3=E7=A0=81=E5=BA=93?= =?UTF-8?q?=E6=96=87=E4=BB=B6sha?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ci/pipelines_controller.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/controllers/ci/pipelines_controller.rb b/app/controllers/ci/pipelines_controller.rb index b75a8478b..4ff6837b2 100644 --- a/app/controllers/ci/pipelines_controller.rb +++ b/app/controllers/ci/pipelines_controller.rb @@ -61,12 +61,10 @@ class Ci::PipelinesController < Ci::BaseController sha = get_pipeline_file_sha(pipeline.file_name, pipeline.branch) if sha logger.info "#{pipeline.file_name}已存在" - pipeline.update!(sync: 1, sha: sha) else interactor = Gitea::CreateFileInteractor.call(current_user.gitea_token, @owner.login, content_params) if interactor.success? logger.info "#{pipeline.file_name}创建成功" - pipeline.update!(sync: 1, sha: interactor.result['content']['sha']) end end end @@ -155,10 +153,7 @@ class Ci::PipelinesController < Ci::BaseController end end end - @sha = pipeline.sha - unless @sha - @sha = get_pipeline_file_sha(pipeline.file_name, pipeline.branch) - end + @sha = get_pipeline_file_sha(pipeline.file_name, pipeline.branch) trigger = '' trigger += " branch:\r\n - #{pipeline.branch}\r\n" unless pipeline.branch.blank? unless pipeline.event.blank?