feat: support skipping based on labels
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user