Skip to content

Commit ac75096

Browse files
AurelioDeRosaclayreimann
authored andcommitted
feature(repository): add mergePullRequest
Closes github-tools#278, closes github-tools#281
1 parent 0198ac0 commit ac75096

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/Repository.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,18 @@ class Repository extends Requestable {
722722
deleteRelease(id, cb) {
723723
return this._request('DELETE', `/repos/${this.__fullname}/releases/${id}`, null, cb);
724724
}
725+
726+
/**
727+
* Merge a pull request
728+
* @see https://developer.github.com/v3/pulls/#merge-a-pull-request-merge-button
729+
* @param {number|string} number - the number of the pull request to merge
730+
* @param {Object} options - the merge options for the pull request
731+
* @param {Requestable.callback} [cb] - will receive the merge information if the operation is successful
732+
* @return {Promise} - the promise for the http request
733+
*/
734+
mergePullRequest(number, options, cb) {
735+
return this._request('PUT', `/repos/${this.__fullname}/pulls/${number}/merge`, options, cb);
736+
}
725737
}
726738

727739
module.exports = Repository;

0 commit comments

Comments
 (0)