Created
February 16, 2016 06:49
-
-
Save siroken3/b750be8d079c8f7e48f7 to your computer and use it in GitHub Desktop.
How to get PullRequest object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var GitHubApi = require('github'), | |
Promise = require('bluebird'), | |
sprintf = require('sprintf'); | |
var github = new GitHubApi({ | |
version: '3.0.0', | |
protocol: 'https', | |
}); | |
github.authenticate({ | |
type: 'oauth', | |
token: 'SECRET-TOKEN', | |
}); | |
var ghprget = Promise.promisify( | |
github.pullRequests.get, GitHubApi | |
); | |
ghprget({ | |
user: 'kouzoh', | |
repo: 'SOMETHING-REPO-NAME', | |
number: 1 | |
}).then(function(pr) { | |
console.log(pr); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment