Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Commit

Permalink
fix(merge-method): aligned to the final version of defining merge-method
Browse files Browse the repository at this point in the history
rebase is not yet supported. details of the api release:
https://developer.github.com/changes/2017-04-07-end-merge-methods-api-preview/

for #19
  • Loading branch information
travi committed Jul 2, 2017
1 parent d4d2116 commit 2c42229
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/github/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function (githubCredentials) {
sha,
commit_title: `greenkeeper-keeper(pr: ${prNumber}): :white_check_mark:`,
commit_message: `greenkeeper-keeper(pr: ${prNumber}): :white_check_mark:`,
squash
merge_method: squash ? 'squash' : 'merge'
}).then(result => {
log(['info', 'PR', 'integrated'], url);
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ defineSupportCode(({Before, After, Given, setWorldConstructor}) => {
sha: this.sha,
commit_title: `greenkeeper-keeper(pr: ${this.prNumber}): :white_check_mark:`,
commit_message: `greenkeeper-keeper(pr: ${this.prNumber}): :white_check_mark:`,
squash: this.squash
merge_method: this.squash ? 'squash' : 'merge'
})
.reply(OK, uri => {
this.mergeUri = uri;
Expand Down
16 changes: 14 additions & 2 deletions test/unit/github/actions-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,24 @@ suite('github actions', () => {

suite('accept PR', () => {
test('that the referenced PR gets accepted', () => {
const squash = any.boolean();
const squash = false;
put.withArgs(`${url}/merge`, {
sha,
commit_title: `greenkeeper-keeper(pr: ${prNumber}): :white_check_mark:`,
commit_message: `greenkeeper-keeper(pr: ${prNumber}): :white_check_mark:`,
squash
merge_method: 'merge'
}).resolves(response);

return assert.becomes(actions.acceptPR(url, sha, prNumber, squash, log), response);
});

test('that the referenced PR gets squashed when configured to do so', () => {
const squash = true;
put.withArgs(`${url}/merge`, {
sha,
commit_title: `greenkeeper-keeper(pr: ${prNumber}): :white_check_mark:`,
commit_message: `greenkeeper-keeper(pr: ${prNumber}): :white_check_mark:`,
merge_method: 'squash'
}).resolves(response);

return assert.becomes(actions.acceptPR(url, sha, prNumber, squash, log), response);
Expand Down

0 comments on commit 2c42229

Please sign in to comment.