Skip to content

Commit c26a07f

Browse files
author
Eunjae Lee
authored
fix: accept an array for pullRequestReviewer (#314)
1 parent 2c4a2e4 commit c26a07f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

GUIDE.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ When you review and merge the PR, your CI will run `shipjs trigger` and it will
195195
4. push to git remote.
196196
197197
> 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.
198-
>
198+
>
199199
> You can go to "Settings" menu of your repository, and even force "Squash and merge" behavior under "Merge button" section.
200200
201201
#### `toReleaseBranch` strategy
@@ -220,7 +220,7 @@ So the flow is like this:
220220
You see the difference between two strategies, right?
221221
222222
> 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.
223-
>
223+
>
224224
> You go to "Settings" menu of your repository, and even force "Merge pull request" behavior under "Merge button" section.
225225
226226
### Monorepo
@@ -331,10 +331,12 @@ You can assign reviewers on the PR.
331331
```js
332332
module.exports = {
333333
pullRequestReviewer: "user-name-or-team-name"
334+
// or
335+
pullRequestReviewer: ["user1", "user2", "user3"]
334336
};
335337
```
336338
337-
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).
339+
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.
338340
339341
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).
340342

packages/shipjs/src/step/prepare/createPullRequest.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,15 @@ export default ({
6060
});
6161
const filePath = tempWrite.sync(message);
6262
run(`git remote prune ${remote}`, dir, dryRun);
63+
const reviewer = Array.isArray(pullRequestReviewer)
64+
? pullRequestReviewer.join(',')
65+
: pullRequestReviewer;
6366
const createPullRequestCommand = [
6467
'hub pull-request',
6568
`--base ${destinationBranch}`,
6669
noBrowse ? undefined : '--browse',
6770
'--push',
68-
pullRequestReviewer ? `--reviewer ${pullRequestReviewer}` : undefined,
71+
pullRequestReviewer ? `--reviewer ${reviewer}` : undefined,
6972
`--file ${filePath}`,
7073
]
7174
.filter(Boolean)

0 commit comments

Comments
 (0)