Commit 7e782ddc authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'trigger-build-docs-branch-check' into 'master'

Move rescue clause to branch creation method

See merge request gitlab-org/gitlab!38027
parents 313b826d 9aeede33
......@@ -274,6 +274,8 @@ module Trigger
def create_remote_branch!
Gitlab.create_branch(downstream_project_path, ref, 'master')
puts "=> Remote branch '#{ref}' created"
rescue Gitlab::Error::BadRequest
puts "=> Remote branch '#{ref}' already exists!"
end
def cancel_latest_pipeline!
......@@ -292,8 +294,6 @@ module Trigger
# Cancel the pipeline
Gitlab.cancel_pipeline(downstream_project_path, pipeline_id)
rescue Gitlab::Error::BadRequest
puts "=> Remote branch '#{ref}' already exists!"
end
def display_success_message
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment