Skip to content

Commit 809e7f5

Browse files
author
Developer
committed
继续
1 parent 17768fd commit 809e7f5

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

.github/workflows/close-invalid-issues.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
issues: write
1212
steps:
1313
- uses: actions/github-script@v7
14+
env:
15+
ABUSIVE_WORDS: ${{ secrets.ABUSIVE_WORDS }}
1416
with:
1517
script: |
1618
const { owner, repo } = context.repo;
@@ -19,13 +21,9 @@ jobs:
1921
const body = (context.payload.issue.body || '').toLowerCase();
2022
const text = title + ' ' + body;
2123
22-
// --- 第一层:攻击性内容 ---
23-
const abusiveWords = [
24-
'傻逼','sb','垃圾','废物','狗屎','他妈','滚','草泥马',
25-
'fuck','shit','操你','你妈','去死','蠢货','弱智','脑残',
26-
'煞笔','白痴','混蛋','烂货','简历','个人信息','B站','假','找工作','金沙'
27-
];
28-
const isAbusive = abusiveWords.some(w => text.includes(w));
24+
// --- 第一层:攻击性内容(词库存于 Secret: ABUSIVE_WORDS,逗号分隔)---
25+
const abusiveWords = (process.env.ABUSIVE_WORDS || '').split(',').map(w => w.trim()).filter(Boolean);
26+
const isAbusive = abusiveWords.some(w => w && text.includes(w.toLowerCase()));
2927
3028
if (isAbusive) {
3129
await github.rest.issues.createComment({

0 commit comments

Comments
 (0)