@dog-ai/github-wrapper
Advanced tools
Comparing version 1.1.3 to 1.1.4
@@ -123,31 +123,36 @@ 'use strict'; | ||
return this.getOrgRepos(owner).mapSeries(function (repo) { | ||
var name = repo.name; | ||
var mergeGreenkeeperPullRequest = function mergeGreenkeeperPullRequest(owner, repoName, pullRequest) { | ||
var isGreenkeeper = pullRequest.user.login === 'greenkeeper[bot]'; | ||
var isSuccess = pullRequest.combinedStatus[0].state === 'success'; | ||
var statuses = pullRequest.combinedStatus[0].statuses; | ||
var isVerified = _.find(statuses, { context: 'greenkeeper/verify', state: 'success' }); | ||
return _this3.getRepoPullRequestsByState(owner, name, 'open').mapSeries(function (pullRequest) { | ||
var isGreenkeeper = pullRequest.user.login === 'greenkeeper[bot]'; | ||
var isSuccess = pullRequest.combinedStatus[0].state === 'success'; | ||
var statuses = pullRequest.combinedStatus[0].statuses; | ||
var isVerified = _.find(statuses, { context: 'greenkeeper/verify', state: 'success' }); | ||
if (isGreenkeeper && isSuccess && isVerified) { | ||
var number = pullRequest.number; | ||
var sha = pullRequest.sha; | ||
if (isGreenkeeper && isSuccess && isVerified) { | ||
var number = pullRequest.number; | ||
var sha = pullRequest.sha; | ||
return _this3.mergePullRequest(owner, name, number, sha).then(function () { | ||
return mergedPullRequests.push({ owner: owner, name: name, number: number, sha: sha, success: true }); | ||
}).catch(function (error) { | ||
return mergedPullRequests.push({ | ||
owner: owner, | ||
name: name, | ||
number: number, | ||
sha: sha, | ||
success: false, | ||
error: error | ||
}); | ||
return _this3.mergePullRequest(owner, repoName, number, sha).then(function () { | ||
return mergedPullRequests.push({ owner: owner, repoName: repoName, number: number, sha: sha, success: true }); | ||
}).catch(function (error) { | ||
return mergedPullRequests.push({ | ||
owner: owner, | ||
repoName: repoName, | ||
number: number, | ||
sha: sha, | ||
success: false, | ||
error: error | ||
}); | ||
} | ||
}); | ||
} | ||
}; | ||
return this.getOrgRepos(owner).mapSeries(function (repo) { | ||
var repoName = repo.name; | ||
return _this3.getRepoPullRequestsByState(owner, repoName, 'open').mapSeries(function (pullRequest) { | ||
return mergeGreenkeeperPullRequest(owner, repoName, pullRequest); | ||
}).catch(function () {}); | ||
}).catch(function () {}).finally(function () { | ||
}).then(function () { | ||
return mergedPullRequests; | ||
}); | ||
}).catch(function () {}); | ||
} | ||
@@ -154,0 +159,0 @@ }]); |
{ | ||
"name": "@dog-ai/github-wrapper", | ||
"description": "A GitHub wrapper library", | ||
"version": "1.1.3", | ||
"main": "lib/github-wrapper.js", | ||
"version": "1.1.4", | ||
"main": "lib/index.js", | ||
"repository": { | ||
@@ -38,3 +38,3 @@ "type": "git", | ||
"standard": "9.0.0-beta.0", | ||
"testdouble": "1.11.1" | ||
"testdouble": "2.1.2" | ||
}, | ||
@@ -41,0 +41,0 @@ "config": { |
@@ -6,3 +6,2 @@ # A GitHub wrapper library | ||
[![Coverage Status](https://coveralls.io/repos/github/dog-ai/github-wrapper/badge.svg?branch=master)](https://coveralls.io/github/dog-ai/github-wrapper?branch=master) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/dog-ai/github-wrapper.svg)](https://greenkeeper.io/) | ||
[![](https://img.shields.io/github/release/dog-ai/github-wrapper.svg)](https://github.com/dog-ai/github-wrapper/releases) | ||
@@ -9,0 +8,0 @@ [![Version](https://img.shields.io/npm/v/@dog-ai/github-wrapper.svg)](https://www.npmjs.com/package/@dog-ai/github-wrapper) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8655
5
139
30