Skip to content

feat(ci): automated comment spam protection — block spam accounts and auto-moderate PR comments #751

Closed

Description

@diberry

Incident

A spam account (nkleadproofficial-del) posted a garbage recruitment ad comment on PR #725. This is an open-source repo and these drive-by spam comments will keep happening.

Problem

Currently there is no automated moderation for comments on issues and PRs. Brady has to manually clean up spam comments, hide them, and block offending accounts. This is a recurring maintenance burden that scales with repo visibility.

Need

Automated way to detect and hide/delete spam comments and block repeat offenders:

  • Detect spam comments based on signals: new account age, zero repo activity, spam content patterns
  • Act on detected spam: minimize (hide) the comment automatically
  • Prevent repeat offenders: leverage GitHub native interaction limits

References

Activity

  1. added 5 commits that reference this issue on Apr 2, 2026
    3507235
    77b54f7
    7d6bcee
    1bba0d6
    756b24a
  2. diberry commented on Apr 3, 2026

    @diberry
    ContributorAuthor

    Research: Spam Protection Approach

    Investigated how major MS OSS repos handle comment spam:

    Azure SDK — Custom C# event processor (20+ rules), auto-lock closed issues after 90 days, stale issue management. Heavy investment shared across all Azure SDK repos.

    VS Code — Command-based moderation (/spam command) restricted to 4 named moderators. Label-driven auto-close (11+ labels). Event-driven, no scheduled cleanup.

    TypeScript — Daily cron job closes labeled stale issues via gh CLI. 11 close-reason labels. No explicit spam command.

    dotnet/runtime — Multi-layered: ML-based issue labeler, auto-lock after 30 days inactivity, AI triage skill. Most sophisticated.

    Common findings: None use github/ai-moderator (doesn't exist as official action). None filter by account age. All rely on label-driven automation + scheduled cleanup.

    Recommended Approach (Layered)

    1. DecimalTurn/Comment-Filter action — auto-hides comments with malicious links, shortened URLs, mass @-mentions. Handles comment removal. Drop-in, zero config.
    2. Custom scripts/moderate-spam.mjs — closes issues/PRs from new accounts with spam patterns. Handles issue/PR closure. Follows repo's existing script patterns.
    3. Auto-lock cron job — locks closed issues/PRs after 30 days inactivity (dotnet/runtime pattern). Prevents spam resurrection on old threads.

    No external API keys. No third-party trust beyond one lightweight action. Prior attempt (PR #753) was closed without merge — starting fresh.

  3. diberry commented on Apr 6, 2026

    @diberry
    ContributorAuthor

    Closed: Comment spam protection implemented in PR #800 (rebased, CI green, awaiting merge).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions