diff --git a/app/controllers/api/v1/projects/pipelines_controller.rb b/app/controllers/api/v1/projects/pipelines_controller.rb index da9e29e7b..a0f2c5609 100644 --- a/app/controllers/api/v1/projects/pipelines_controller.rb +++ b/app/controllers/api/v1/projects/pipelines_controller.rb @@ -80,7 +80,7 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController tip_exception("已经存在#{params[:pipeline_name]}流水线!") if has_pipeline.present? if @pipeline.yaml.present? sha = get_pipeline_file_sha(@pipeline.file_name, @pipeline.branch) - new_file_sha = get_pipeline_file_sha(params[:pipeline_name], @pipeline.branch) + new_file_sha = get_pipeline_file_sha(".gitea/workflows/#{params[:pipeline_name]}.yml", @pipeline.branch) # 重命名的新文件存在时,直接修改新文件new_file_sha if sha.present? && new_file_sha.present? interactor = Gitea::UpdateFileInteractor.call(current_user.gitea_token, @owner.login, content_params("update", params[:pipeline_name]).merge(sha: new_file_sha, from_path: ".gitea/workflows/#{@pipeline.pipeline_name}.yml"))