mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-08-19 18:25:58 +08:00
feat: add `$exclude-empty (#112)
* feat: add `$exclude-empty * docs: up * chore: format
This commit is contained in:
@@ -6,6 +6,7 @@ import utc from 'dayjs/plugin/utc';
|
||||
|
||||
import * as core from '../core';
|
||||
import type { IIssueCoreEngine, IListIssuesParams, TCommentInfo, TIssueList } from '../issue';
|
||||
import { EConst } from '../shared';
|
||||
import type { TCloseReason, TEmoji, TIssueState, TOutList } from '../types';
|
||||
import { checkDuplicate, matchKeyword, replaceStr2Arr } from '../util';
|
||||
import {
|
||||
@@ -67,8 +68,12 @@ export async function doQueryIssues(
|
||||
*/
|
||||
if (bodyCheck && titleCheck && issue.pull_request === undefined) {
|
||||
if (excludeLabelsArr.length) {
|
||||
for (let i = 0; i < issue.labels.length; i += 1) {
|
||||
if (excludeLabelsArr.includes(issue.labels[i].name)) return;
|
||||
if (issue.labels.length) {
|
||||
for (let i = 0; i < issue.labels.length; i += 1) {
|
||||
if (excludeLabelsArr.includes(issue.labels[i].name)) return;
|
||||
}
|
||||
} else {
|
||||
if (excludeLabelsArr.includes(EConst.ExcludeEmpty)) return;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -15,3 +15,7 @@ export const ELockReasons = {
|
||||
resolved: 'resolved',
|
||||
spam: 'spam',
|
||||
};
|
||||
|
||||
export const EConst = {
|
||||
ExcludeEmpty: '$exclude-empty',
|
||||
};
|
||||
|
Reference in New Issue
Block a user