summaryrefslogtreecommitdiff
path: root/app/services/ci/list_config_variables_service.rb
blob: b5dc192b5125687acb22a1fa41eef01152d72ff2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

module Ci
  class ListConfigVariablesService < ::BaseService
    def execute(sha)
      config = project.ci_config_for(sha)
      return {} unless config

      result = Gitlab::Ci::YamlProcessor.new(config).execute
      result.valid? ? result.variables_with_data : {}
    end
  end
end