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

update_service.rb « commits « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7ec678ff1cf3fb11af53b779d504b05402c7c9b1 (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
28
# frozen_string_literal: true

module Commits
  class UpdateService < BaseService
    def execute(commit)
      tag_commit(commit)
    end

    private

    def tag_commit(commit)
      # TODO authorize
      return unless params[:tag_name]

      tag_name = params[:tag_name]
      message = params[:tag_message]
      release_description = nil

      result = Tags::CreateService
        .new(commit.project, current_user)
        .execute(tag_name, commit.sha, message, release_description)

      if result[:status]
        commit
      end
    end
  end
end