diff --git a/lib/Issue.js b/lib/Issue.js index d5c03d4a..07fa2b1a 100644 --- a/lib/Issue.js +++ b/lib/Issue.js @@ -190,6 +190,17 @@ class Issue extends Requestable { deleteMilestone(milestone, cb) { return this._request('DELETE', `/repos/${this.__repository}/milestones/${milestone}`, null, cb); } + + /** + * Create a new label + * @see https://developer.github.com/v3/issues/labels/#create-a-label + * @param {Object} labelData - the label definition + * @param {Requestable.callback} [cb] - will receive the object representing the label + * @return {Promise} - the promise for the http request + */ + createLabel(labelData, cb) { + return this._request('POST', `/repos/${this.__repository}/labels`, labelData, cb); + } } module.exports = Issue;