mirror of
https://gh-proxy.org/https://github.com/tiajinsha/JKVideo
synced 2026-07-07 23:18:38 +08:00
继续
This commit is contained in:
12
.github/workflows/close-invalid-issues.yml
vendored
12
.github/workflows/close-invalid-issues.yml
vendored
@@ -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({
|
||||||
|
|||||||
Reference in New Issue
Block a user