Welcome to mirror list, hosted at ThFree Co, Russian Federation.

helpers.rb « chain « pipeline « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7ab7a64c7e30d70aba21bcb18fe5fcb4fd799cf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
module Gitlab
  module Ci
    module Pipeline
      module Chain
        module Helpers
          include Gitlab::Utils::StrongMemoize

          def branch_exists?
            strong_memoize(:is_branch) do
              project.repository.branch_exists?(pipeline.ref)
            end
          end

          def tag_exists?
            strong_memoize(:is_tag) do
              project.repository.tag_exists?(pipeline.ref)
            end
          end

          def error(message)
            pipeline.errors.add(:base, message)
          end
        end
      end
    end
  end
end