Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add add label to an issue#461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
asmsuechan wants to merge3 commits intogithub-tools:master
base:master
Choose a base branch
Loading
fromasmsuechan:add-add-label-to-an-issue
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletionslib/Issue.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -246,6 +246,30 @@ class Issue extends Requestable {
deleteLabel(label, cb) {
return this._request('DELETE', `/repos/${this.__repository}/labels/${label}`, null, cb);
}

/**
* Add a label to an issue
* @see https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue
* @param {number} issue - the id of the issue to comment on
* @param {array} label - the names of the label to add to the issue
* @param {Requestable.callback} [cb] - will receive the status
* @return {Promise} - the promise for the http request
*/
addLabel(issue, label, cb) {
return this._request('POST', `/repos/${this.__repository}/issues/${issue}/labels`, label, cb);
}

/**
* Remove a label from an issue
* @see https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue
* @param {number} issue - the id of the issue to comment on
* @param {string} label - the name of the label to remove to the issue
* @param {Requestable.callback} [cb] - will receive the status
* @return {Promise} - the promise for the http request
*/
removeLabel(issue, label, cb) {
return this._request('DELETE', `/repos/${this.__repository}/issues/${issue}/labels/${label}`, null, cb);
}
}

module.exports = Issue;

[8]ページ先頭

©2009-2025 Movatter.jp