Skip to content

Commit 1896d0e

Browse files
adtaylorfengmk2
authored andcommitted
feat: gets a list of all commits for a single merge request. (#25)
* adds createTag to repository resource
1 parent dbe8a34 commit 1896d0e

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,15 @@ Parameters:
952952
- note_id (required) - The ID of a note
953953
- body (required) - The content of a note
954954

955+
#### client.mergeRequests.listCommits({id, merge_request_id})
956+
957+
Gets a list of all commits for a single merge request.
958+
959+
Parameters:
960+
961+
- id (required) - The ID of a project
962+
- merge_request_id (required) - The ID of a project merge request
963+
955964
---
956965

957966
### Milestones

lib/resources/merge_request.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ MergeRequest.prototype.updateNote = function (params, callback) {
2929
MergeRequest.prototype.merge = function (params, callback) {
3030
this.client.request('put', this.onePath + '/merge', params, callback);
3131
};
32+
33+
MergeRequest.prototype.listCommits = function (params, callback) {
34+
this.client.request('get', this.onePath + '/commits', params, callback);
35+
}

lib/resources/repository.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,22 @@ Repository.prototype.getRawBlob = function (params, callback) {
146146
params.contentType = 'buffer';
147147
this.client.request('get', this.path + '/:sha', params, callback);
148148
};
149+
150+
/**
151+
* Creates a new tag in the repository that points to the supplied ref.
152+
*
153+
* @param {Object} params
154+
* - {String} id (required) - The ID of a project
155+
* - {String} tag_name (required) - The name of a tag
156+
* - {String} ref (required) - Create tag using commit SHA, another tag name, or branch name.
157+
* - {String} message (optional) - Creates annotated tag.
158+
* - {String} release_description (optional) - Add release notes to the git tag and store it in the GitLab database.
159+
* @param {Function} callback
160+
*/
161+
162+
Repository.prototype.createTag = function (params, callback) {
163+
params.type = 'tags';
164+
this.client.request('POST', this.path, params, callback);
165+
};
166+
167+

0 commit comments

Comments
 (0)