diff --git a/app/controllers/api/v1/projects/pipelines_controller.rb b/app/controllers/api/v1/projects/pipelines_controller.rb index c1edcbbd2..6cd4bff67 100644 --- a/app/controllers/api/v1/projects/pipelines_controller.rb +++ b/app/controllers/api/v1/projects/pipelines_controller.rb @@ -18,7 +18,6 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController @pipeline.yaml = pipeline_yaml @pipeline.save! sha = get_pipeline_file_sha(@pipeline.file_name, @pipeline.branch) - Rails.logger.info "sha==========#{sha}" tip_exception("#{@pipeline.file_name}已存在") if sha interactor = Gitea::CreateFileInteractor.call(current_user.gitea_token, @owner.login, content_params) tip_exception(interactor.error) unless interactor.success? @@ -34,8 +33,6 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController tip_exception("流水线yaml内空不能为空") if pipeline_yaml.blank? @pipeline.yaml = pipeline_yaml sha = get_pipeline_file_sha(@pipeline.file_name, @pipeline.branch) - Rails.logger.info "sha==========#{sha}" - Rails.logger.info "sha==========#{sha.present?}" interactor = sha.present? ? Gitea::UpdateFileInteractor.call(current_user.gitea_token, @owner.login, content_params) : Gitea::CreateFileInteractor.call(current_user.gitea_token, @owner.login, content_params) tip_exception(interactor.error) unless interactor.success? render_ok @@ -147,7 +144,7 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController filepath: ".gitea/workflows/#{URI.parse(@pipeline.pipeline_name)}.yaml", branch: @pipeline.branch, new_branch: @pipeline.branch, - content: @pipeline.yaml, + content: Base64.encode64(@pipeline.yaml), message: 'create pipeline', committer: { email: current_user.mail,