lib/pullRequests.js
function getPRsForRepo(repo) {
  print(['Fetching PRs for ', clc.yellow.bold(`${repo.owner.login}/${repo.name}`)], debug);
  return new Promise((resolve, reject) => {
    github.pullRequests.getAll({
      user: repo.owner.login,
      repo: repo.name,
      state: 'open'
    }, (err, prs) => {
      if (err) {
        return reject(err);
      }
      return resolve(prs.filter((pr) => {
        return pr && pr.head;
      }));
    });
  });
}
function getPRsForRepo(repo) {
  print(['Fetching PRs for ', clc.yellow.bold(`${repo.owner.login}/${repo.name}`)], debug);
  return new Promise((resolve, reject) => {
    github.pullRequests.getAll({
      user: repo.owner.login,
      repo: repo.name,
      state: 'open'
    }, (err, prs) => {
      if (err) {
        return reject(err);
      }
      return resolve(prs.filter((pr) => {
        return pr && pr.head;
      }));
    });
  });
}
function getPRsForRepo ( repo ) { print ( [ 'Fetching PRs for ' , clc . yellow . bold ( ` ${ repo . owner . login } ${ repo . name } ` ) ] , debug ) ; return new Promise ( ( resolve , reject ) => { github . pullRequests . getAll ( { user : repo . owner . login , repo : repo . name , state : 'open' } , ( err , prs ) => { if ( err ) { return reject ( err ) ; } return resolve ( prs . filter ( ( pr ) => { return pr && pr . head ; } ) ) ; } ) ; } ) ; }
Fetch open pull requests for a single repository
@param  {Object}  repo Repository metadata
@return {Promise}      Resolves to a list of pull requests
Fetch open pull requests for a single repository