debian-mirror-gitlab/lib/gitlab/ci/pipeline/chain/validate/repository.rb

34 lines
749 B
Ruby
Raw Normal View History

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-05-18 00:54:41 +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?
2020-07-28 23:09:34 +05:30
error('Ref is ambiguous')
2019-01-03 12:48:30 +05:30
end
2018-03-17 18:26:18 +05:30
end
def break?
@pipeline.errors.any?
end
end
end
end
end
end
end