debian-mirror-gitlab/app/services/commits/tag_service.rb

26 lines
587 B
Ruby
Raw Normal View History

2018-11-20 20:47:30 +05:30
# frozen_string_literal: true
module Commits
class TagService < BaseService
def execute(commit)
unless params[:tag_name]
return error('Missing parameter tag_name')
end
tag_name = params[:tag_name]
message = params[:tag_message]
result = Tags::CreateService
.new(commit.project, current_user)
2019-02-13 22:33:31 +05:30
.execute(tag_name, commit.sha, message)
2018-11-20 20:47:30 +05:30
if result[:status] == :success
tag = result[:tag]
SystemNoteService.tag_commit(commit, commit.project, current_user, tag.name)
end
result
end
end
end