From 08bd36c133a4f79d32af199ab829f305a599e06a Mon Sep 17 00:00:00 2001 From: joe fleming Date: Thu, 28 Feb 2019 17:34:00 -0700 Subject: [PATCH] feat: support skipping based on labels --- src/index.mjs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/index.mjs b/src/index.mjs index b3a1297..fcc4f18 100644 --- a/src/index.mjs +++ b/src/index.mjs @@ -23,6 +23,7 @@ async function ghActionBot() { COMMENT_BODY_REGEXP_FLAGS, COMMENT_ACTOR, PULL_LABEL_FILTER, + PULL_LABEL_EXCLUDE, PULL_AUTHOR_FILTER, PULL_RETEST_BODY, ACTION_RETRY_DELAY = 3000, @@ -71,6 +72,17 @@ async function ghActionBot() { return false; } + // filter out matching exclusion tags + if (PULL_LABEL_EXCLUDE) { + const exclude = PULL_LABEL_EXCLUDE.split(',').some(label => pull.labels.includes(label)); + if (exclude) { + logger.debug( + `SKIP PULL #${pull.number}: label matches exclusion labels '${PULL_LABEL_EXCLUDE}'` + ); + return false; + } + } + return { comment, pull }; }) )).filter(Boolean);