github-pr-release
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -88,2 +88,6 @@ var request = require('request') | ||
} else if (res.statusCode === 422) { | ||
var errMessage = res.body.errors[0].message | ||
if (!errMessage.match(/pull request already exists/)) { | ||
return Promise.reject(new Error(errMessage)) | ||
} | ||
return self.get(self.pullRequestEndpoint(), { | ||
@@ -90,0 +94,0 @@ base: self.base, |
{ | ||
"name": "github-pr-release", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Create a release pull request by Github API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# github-pr-release | ||
[![Build Status](https://travis-ci.org/uiureo/github-pr-release.svg)](https://travis-ci.org/uiureo/github-pr-release) | ||
[![](https://img.shields.io/npm/v/github-pr-release.svg)](https://www.npmjs.com/package/github-pr-release) | ||
Create a release pull request by using Github API. In fact, this is a Node.js port of [git-pr-release]( https://github.com/motemen/git-pr-release). | ||
Create a release pull request by using Github API. Inspired by [git-pr-release]( https://github.com/motemen/git-pr-release). | ||
@@ -59,2 +60,5 @@ * No dependency on git. You can easily deploy it to Heroku etc. | ||
) | ||
.catch((err) -> | ||
msg.send("Create release PR failed: " + err.message) | ||
) | ||
``` | ||
@@ -61,0 +65,0 @@ |
@@ -41,3 +41,13 @@ /* global describe before it */ | ||
.post('/repos/uiureo/awesome-app/pulls') | ||
.reply(422) | ||
.reply(422, { | ||
message: 'Validation Failed', | ||
errors: [ | ||
{ | ||
resource: 'PullRequest', | ||
code: 'custom', | ||
message: 'A pull request already exists for uiureo:master.' | ||
} | ||
], | ||
documentation_url: 'https://developer.github.com/v3/pulls/#create-a-pull-request' | ||
}) | ||
@@ -58,2 +68,25 @@ nock('https://api.github.com/') | ||
}) | ||
describe('when no changes between head and base', function () { | ||
nock('https://api.github.com/') | ||
.post('/repos/uiureo/awesome-app/pulls') | ||
.reply(422, { | ||
message: 'Validation Failed', | ||
errors: [ | ||
{ | ||
resource: 'PullRequest', | ||
code: 'custom', | ||
message: 'No commits between production and master' | ||
} | ||
], | ||
documentation_url: 'https://developer.github.com/v3/pulls/#create-a-pull-request' | ||
}) | ||
it('rejects with error message', function (done) { | ||
this.client.prepareReleasePR().catch(function (error) { | ||
assert(error.message === 'No commits between production and master') | ||
done() | ||
}) | ||
}) | ||
}) | ||
}) | ||
@@ -60,0 +93,0 @@ |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
14272
11
327
67
0