@dog-ai/github-wrapper
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -116,2 +116,26 @@ 'use strict'; | ||
} | ||
}, { | ||
key: 'mergeGreenkeeperPullRequests', | ||
value: function mergeGreenkeeperPullRequests(owner) { | ||
var _this3 = this; | ||
return this.getOrgRepos(owner).mapSeries(function (repo) { | ||
var name = repo.name; | ||
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; | ||
return _this3.mergePullRequest(owner, name, number, sha).catch(function (error) { | ||
return console.error(error); | ||
}); | ||
} | ||
}); | ||
}); | ||
} | ||
}]); | ||
@@ -118,0 +142,0 @@ |
{ | ||
"name": "@dog-ai/github-wrapper", | ||
"description": "A GitHub wrapper", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"main": "lib/github-wrapper.js", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -8,1 +8,22 @@ # A GitHub wrapper | ||
[![](https://img.shields.io/github/release/dog-ai/github-wrapper.svg)](https://github.com/dog-ai/github-wrapper/releases) | ||
A GitHub wrapper. | ||
### Features | ||
* Supports [Bluebird](https://github.com/petkaantonov/bluebird) :bird: promises :white_check_mark: | ||
### How to install | ||
``` | ||
npm install @dog-ai/github-wrapper | ||
``` | ||
### How to use | ||
#### Use it in your app | ||
```javascript | ||
const GitHub = require('github-wrapper') | ||
const github = new GitHub({ auth: { type: 'token', token: 'my-token' } }) | ||
return github.getOrgRepos('dog-ai') | ||
.mapSeries((repo) => console.log(repo.name)) | ||
``` |
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
8066
120
29