diff options
author | Peter Leitzen <pl@neopoly.de> | 2018-07-21 13:24:07 +0300 |
---|---|---|
committer | Peter Leitzen <pl@neopoly.de> | 2018-08-10 17:45:11 +0300 |
commit | a892b2354c953d62445a5cf9ac747ee166256c66 (patch) | |
tree | 7857e2126d2b7935e3decf3dfdd6cd1ecd67f9be /app/services | |
parent | cc1aecdb4f3b3950f50ae53ae842f6b8912f401c (diff) |
Tag a commit via `/tag 1.2.3 message`
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/commits/update_service.rb | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/app/services/commits/update_service.rb b/app/services/commits/update_service.rb index 9cd5ddc7f91..7ec678ff1cf 100644 --- a/app/services/commits/update_service.rb +++ b/app/services/commits/update_service.rb @@ -3,7 +3,26 @@ module Commits class UpdateService < BaseService def execute(commit) - # TODO authorize user + 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 |