summaryrefslogtreecommitdiff
path: root/app/services/quick_actions
diff options
context:
space:
mode:
authorPeter Leitzen <pl@neopoly.de>2018-07-21 12:23:53 +0200
committerPeter Leitzen <pl@neopoly.de>2018-08-10 16:45:11 +0200
commitcc1aecdb4f3b3950f50ae53ae842f6b8912f401c (patch)
treefc8111cf31ce2e2030fab6ad6c2c72e2fd7be98e /app/services/quick_actions
parent2022243a222583daaf9e00d44fa6d1a9d75d4b02 (diff)
downloadgitlab-ce-cc1aecdb4f3b3950f50ae53ae842f6b8912f401c.tar.gz
Implement the `tag` commands
Diffstat (limited to 'app/services/quick_actions')
-rw-r--r--app/services/quick_actions/interpret_service.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/services/quick_actions/interpret_service.rb b/app/services/quick_actions/interpret_service.rb
index 36a35b6afb7..6345f78af90 100644
--- a/app/services/quick_actions/interpret_service.rb
+++ b/app/services/quick_actions/interpret_service.rb
@@ -582,6 +582,23 @@ module QuickActions
@updates[:confidential] = true
end
+ desc 'Tag this commit.'
+ explanation do |(tag_name), _|
+ "Tags this commit to #{tag_name}."
+ end
+ params 'v1.2.3 <message>'
+ parse_params do |tag_name_and_message|
+ tag_name_and_message.split(' ', 2)
+ end
+ condition do
+ issuable.is_a?(Commit)
+ # TODO authorize
+ end
+ command :tag do |(tag_name, message)|
+ @updates[:tag_name] = tag_name
+ @updates[:tag_message] = message
+ end
+
def extract_users(params)
return [] if params.nil?