From 809e7f57f502bd80a7eadaa2ff491adea3c72238 Mon Sep 17 00:00:00 2001 From: Developer Date: Tue, 24 Mar 2026 19:41:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=A7=E7=BB=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/close-invalid-issues.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/close-invalid-issues.yml b/.github/workflows/close-invalid-issues.yml index 4934ee1..48fd96d 100644 --- a/.github/workflows/close-invalid-issues.yml +++ b/.github/workflows/close-invalid-issues.yml @@ -11,6 +11,8 @@ jobs: issues: write steps: - uses: actions/github-script@v7 + env: + ABUSIVE_WORDS: ${{ secrets.ABUSIVE_WORDS }} with: script: | const { owner, repo } = context.repo; @@ -19,13 +21,9 @@ jobs: const body = (context.payload.issue.body || '').toLowerCase(); const text = title + ' ' + body; - // --- 第一层:攻击性内容 --- - const abusiveWords = [ - '傻逼','sb','垃圾','废物','狗屎','他妈','滚','草泥马', - 'fuck','shit','操你','你妈','去死','蠢货','弱智','脑残', - '煞笔','白痴','混蛋','烂货','简历','个人信息','B站','假','找工作','金沙' - ]; - const isAbusive = abusiveWords.some(w => text.includes(w)); + // --- 第一层:攻击性内容(词库存于 Secret: ABUSIVE_WORDS,逗号分隔)--- + const abusiveWords = (process.env.ABUSIVE_WORDS || '').split(',').map(w => w.trim()).filter(Boolean); + const isAbusive = abusiveWords.some(w => w && text.includes(w.toLowerCase())); if (isAbusive) { await github.rest.issues.createComment({