Skip to content

Commit 83775a1

Browse files
AurelioDeRosaclayreimann
authored andcommitted
feature(issue): add createLabel (github-tools#357)
fixes github-tools#328
1 parent 44c072c commit 83775a1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/Issue.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,17 @@ class Issue extends Requestable {
190190
deleteMilestone(milestone, cb) {
191191
return this._request('DELETE', `/repos/${this.__repository}/milestones/${milestone}`, null, cb);
192192
}
193+
194+
/**
195+
* Create a new label
196+
* @see https://developer.github.com/v3/issues/labels/#create-a-label
197+
* @param {Object} labelData - the label definition
198+
* @param {Requestable.callback} [cb] - will receive the object representing the label
199+
* @return {Promise} - the promise for the http request
200+
*/
201+
createLabel(labelData, cb) {
202+
return this._request('POST', `/repos/${this.__repository}/labels`, labelData, cb);
203+
}
193204
}
194205

195206
module.exports = Issue;

0 commit comments

Comments
 (0)