From 0a66c00ca32a59a88b61b8d96fc619d888019dc1 Mon Sep 17 00:00:00 2001 From: HANATANI Takuma Date: Thu, 31 Jan 2019 17:26:31 +0900 Subject: [PATCH] feat: reviewer customize function is now available --- .env.sample | 2 ++ index.js | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.env.sample b/.env.sample index d426711..f16fdf4 100644 --- a/.env.sample +++ b/.env.sample @@ -2,6 +2,8 @@ USER_NAME=vuejs-jp-bot EMAIL=vuejs-jp-bot@users.noreply.github.com +REVIEWERS=re-fort,kazupon,potato4d + ORIGIN_REPO_URL=git@github.com:vuejs-jp-bot/jp.vuejs.org.git ORIGIN_REPO_DEFAULT_BRANCH=lang-ja diff --git a/index.js b/index.js index 5db23f1..d10ae74 100644 --- a/index.js +++ b/index.js @@ -45,6 +45,8 @@ let repo = new Repo( } ) +let reviewers = process.env.REVIEWERS.split(',') || 're-fort,kazupon,potato4d' + const setup = () => { repo.setup() github.authenticate({ type: 'token', token: process.env.GITHUB_ACCESS_TOKEN }) @@ -137,7 +139,7 @@ const after = async (item, shortHash, issueNo = null) => { const { data: pullRequest } = await github.createPullRequest(remote, { title: Utility.removeHash(item.title), body, branch: shortHash }) if (!pullRequest) return Utility.log('S', `Created new pull request: ${pullRequest.html_url}`) - await github.assignReviewers(remote, { number: pullRequest.number, reviewers: ['re-fort', 'kazupon', 'potato4d'] }) + await github.assignReviewers(remote, { number: pullRequest.number, reviewers: reviewers }) Utility.log('S', 'Assigned reviewers') }