Add spam-guard workflow: 限制新号在 issue/discussion 留言#2
Merged
Conversation
Auto-hides comments and locks issues/discussions created by accounts younger than NEW_ACCOUNT_MAX_AGE_DAYS (default 90 = ~3 months) that are not collaborators/members/prior contributors. Complements the repo interaction limit (which only blocks <24h accounts on issues/PRs and expires) by also covering Discussions and running permanently. All actions are reversible. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0f01ae5 to
bdb5661
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目的
限制新号/垃圾号在 issue 和 discussion 的垃圾留言。「新号」定义:注册 < 3 个月(默认 90 天)。
第一层 — 内置 interaction limit(已生效,不在本 PR 内)
gh api -X DELETE repos/opendb-ai/openDB/interaction-limits第二层 — 本 PR:
.github/workflows/spam-guard.yml对 issue / PR / discussion 的新发帖和评论自动审核,真正落实「<3 个月 = 新号」,并补上 Discussions 覆盖 + 永久生效。
判定:同时满足才动手 ——
NEW_ACCOUNT_MAX_AGE_DAYS(默认 90 天 ≈ 3 个月);动作(全部可逆):
possible-spam标签 + 留言说明 + 锁帖可调开关(workflow 内
env:):NEW_ACCOUNT_MAX_AGE_DAYS(改月龄阈值)、MINIMIZE_COMMENTS、LOCK_NEW_THREADS、CLOSE_NEW_THREADS(默认关)、SPAM_LABEL。注意
LOCK_NEW_THREADS设为false(只打标签 + 留言、交人工复核)。has_discussions=false),discussion.*触发器暂不会触发;开启后无需改动即自动生效。main后,discussion等事件才会派发 —— 合并即激活。GITHUB_TOKEN的issues: write/discussions: write,无需任何额外 secret。🤖 Generated with Claude Code