Skip to content
Open
Changes from 1 commit
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
Next Next commit
added fork to org
  • Loading branch information
benmonro authored Apr 11, 2018
commit 8977ee483902c5f0bf62566c89e8ce4c1ed4a22d
14 changes: 13 additions & 1 deletion lib/Repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,19 @@ class Repository extends Requestable {
fork(cb) {
return this._request('POST', `/repos/${this.__fullname}/forks`, null, cb);
}


/**
* Fork a repository to an organization
* @see https://developer.github.com/v3/repos/forks/#create-a-fork
* @param {String} org - organization where you'd like to create the fork.
* @param {Requestable.callback} cb - will receive the information about the newly created fork
* @return {Promise} - the promise for the http request
*
*/
forkToOrg(org, cb) {
return this._request('POST', `/repos/${this.__fullname}/forks?organization=${org}`, null, cb);
}

/**
* List a repository's forks
* @see https://developer.github.com/v3/repos/forks/#list-forks
Expand Down