This commit is contained in:
Developer
2026-03-24 19:41:44 +08:00
parent 17768fd951
commit 809e7f57f5

View File

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