Skip to content

Instantly share code, notes, and snippets.

@siroken3
Created February 16, 2016 06:49
Show Gist options
  • Save siroken3/b750be8d079c8f7e48f7 to your computer and use it in GitHub Desktop.
Save siroken3/b750be8d079c8f7e48f7 to your computer and use it in GitHub Desktop.
How to get PullRequest object
'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