feat: allow filtering by pr author

This commit is contained in:
2018-10-18 16:41:57 -07:00
parent 87f4a94734
commit 68cccb72a9
3 changed files with 5 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ export default async function() {
COMMENT_BODY_REGEXP_FLAGS,
COMMENT_ACTOR,
PULL_LABEL_FILTER,
PULL_AUTHOR_FILTER,
PULL_RETEST_BODY,
} = process.env;
@@ -36,6 +37,7 @@ export default async function() {
const pull = await getPull(repo, comment.number);
if (pull.state !== 'open') return false; // filter out any closed pulls
if (PULL_AUTHOR_FILTER && !pull.owner !== PULL_AUTHOR_FILTER) return false; // filter on owner
if (PULL_LABEL_FILTER && !pull.labels.includes(PULL_LABEL_FILTER)) return false; // filter on label
return { comment, pull };