Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: accept an array for pullRequestReviewer #314

Merged
merged 2 commits into from
Oct 8, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: accept an array for pullRequestReviewer
eunjae-lee committed Oct 8, 2019
commit 5d10b65bb07e1b346e6d8d56af7edd7d29139bdb
8 changes: 5 additions & 3 deletions GUIDE.md
Original file line number Diff line number Diff line change
@@ -195,7 +195,7 @@ When you review and merge the PR, your CI will run `shipjs trigger` and it will
4. push to git remote.

> When merging a PR from this strategy, you need to "Squash and merge" and make sure the commit title is the same with the title of the PR.
>
>
> You can go to "Settings" menu of your repository, and even force "Squash and merge" behavior under "Merge button" section.

#### `toReleaseBranch` strategy
@@ -220,7 +220,7 @@ So the flow is like this:
You see the difference between two strategies, right?

> When merging a PR from this strategy, you need to "Merge pull request(Create a merge commit)" and also, you must modify the commit title to the title of the PR.
>
>
> You go to "Settings" menu of your repository, and even force "Merge pull request" behavior under "Merge button" section.

### Monorepo
@@ -331,10 +331,12 @@ You can assign reviewers on the PR.
```js
module.exports = {
pullRequestReviewer: "user-name-or-team-name"
// or
pullRequestReviewer: ["user1", "user2", "user3"]
};
```

One thing you need to be aware of is, you cannot assign yourself as a reviewer. You can put github username of your team or colleagues. The value is a comma-separated list(no spaces around the comma).
One thing you need to be aware of is, you cannot assign yourself as a reviewer. You can put github username of your team or colleagues. The value can be either a string or an array of strings.

The assignees will receive a notification from GitHub when the PR is created. Whenever they review and merge the PR, it will be automatically released by the prior configuration you've done [above](#integrate-with-circle-ci).

5 changes: 4 additions & 1 deletion packages/shipjs/src/step/prepare/createPullRequest.js
Original file line number Diff line number Diff line change
@@ -60,12 +60,15 @@ export default ({
});
const filePath = tempWrite.sync(message);
run(`git remote prune ${remote}`, dir, dryRun);
const reviewer = Array.isArray(pullRequestReviewer)
? pullRequestReviewer.join(',')
: pullRequestReviewer;
const createPullRequestCommand = [
'hub pull-request',
`--base ${destinationBranch}`,
noBrowse ? undefined : '--browse',
'--push',
pullRequestReviewer ? `--reviewer ${pullRequestReviewer}` : undefined,
pullRequestReviewer ? `--reviewer ${reviewer}` : undefined,
`--file ${filePath}`,
]
.filter(Boolean)