2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
module Pipeline
|
|
|
|
module Chain
|
|
|
|
module Validate
|
|
|
|
class Repository < Chain::Base
|
|
|
|
include Chain::Helpers
|
|
|
|
|
|
|
|
def perform!
|
2019-07-07 11:18:12 +05:30
|
|
|
unless @command.branch_exists? || @command.tag_exists? || @command.merge_request_ref_exists?
|
2018-03-17 18:26:18 +05:30
|
|
|
return error('Reference not found')
|
|
|
|
end
|
|
|
|
|
|
|
|
unless @command.sha
|
|
|
|
return error('Commit not found')
|
|
|
|
end
|
2019-01-03 12:48:30 +05:30
|
|
|
|
|
|
|
if @command.ambiguous_ref?
|
|
|
|
return error('Ref is ambiguous')
|
|
|
|
end
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def break?
|
|
|
|
@pipeline.errors.any?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|