diff --git a/app/controllers/api/v1/projects/pipelines_controller.rb b/app/controllers/api/v1/projects/pipelines_controller.rb index 97a671d52..4f2895843 100644 --- a/app/controllers/api/v1/projects/pipelines_controller.rb +++ b/app/controllers/api/v1/projects/pipelines_controller.rb @@ -134,12 +134,14 @@ class Api::V1::Projects::PipelinesController < Api::V1::BaseController if interactor.success? file = interactor.result file['sha'] + else + nil end end def content_params { - filepath: ".gitea/workflows/#{@pipeline.pipeline_name}.yaml", + filepath: ".gitea/workflows/#{URI.parse(@pipeline.pipeline_name)}.yaml", branch: @pipeline.branch, new_branch: @pipeline.branch, content: @pipeline.yaml,