summaryrefslogtreecommitdiff
path: root/lib/api/tags.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/tags.rb')
-rw-r--r--lib/api/tags.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/api/tags.rb b/lib/api/tags.rb
index e46d9bb96f0..47621f443e6 100644
--- a/lib/api/tags.rb
+++ b/lib/api/tags.rb
@@ -60,6 +60,27 @@ module API
render_api_error!(result[:message], result[:http_status])
end
end
+
+ # Updates a release notes of a tag
+ #
+ # Parameters:
+ # id (required) - The ID of a project
+ # tag_name (required) - The name of the tag
+ # description (required) - Release notes with markdown support
+ # Example Request:
+ # PUT /projects/:id/repository/tags/:tag_name/release
+ put ':id/repository/tags/:tag_name/release', requirements: { tag_name: /.*/ } do
+ authorize_push_project
+ required_attributes! [:description]
+ result = UpdateReleaseService.new(user_project, current_user).
+ execute(params[:tag_name], params[:description])
+
+ if result[:status] == :success
+ present result[:release], with: Entities::Release
+ else
+ render_api_error!(result[:message], result[:http_status])
+ end
+ end
end
end
end