Skip to content

Commit 83775a1

Browse files
AurelioDeRosaclayreimann
authored andcommitted
feature(issue): add createLabel (#357)
fixes #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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy