Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 0xdevalias/224a24f4496e15e98ce541cf5435f131 to your computer and use it in GitHub Desktop.
Save 0xdevalias/224a24f4496e15e98ce541cf5435f131 to your computer and use it in GitHub Desktop.
Some notes on a proposal for using GitHub Discussions to provide automated moderator notices (eg. handling +1 comment spam) with offense tracking and escalation.

Proposal: Using GitHub Discussions for Automated Moderator Notices (eg. +1 comment spam, etc)

Some notes on a proposal for using GitHub Discussions to provide automated moderator notices (eg. handling +1 comment spam) with offense tracking and escalation.

Table of Contents

Background / Motivation

Noise in GitHub Issues and Pull Requests often comes from trivial comments such as “+1” or “me too.” While GitHub provides reactions (👍) as the correct mechanism for showing support, many users still resort to comments, which creates unnecessary notifications and clutter.

Maintainers need a way to enforce etiquette that avoids spamming threads, while also educating users on correct usage, ideally in a scalable and automated way.

Example Problem: +1 Comment Spam

  • A user posts a comment:
    +1
    
  • This triggers a notification to all subscribers of the issue/PR, creating noise.
  • The comment adds no new information, but GitHub’s interface encourages users to “speak” even when a reaction would suffice.

Proposed Approach

Per-User Discussion Creation

  • Create a dedicated Discussions category (e.g. “Moderator Notices”).
  • Each offending user gets one discussion thread in that category (if not already present).
  • When they post spam (e.g. +1), automation deletes the comment and posts a notice in their dedicated discussion.

Offense Tracking

  • Each offense adds a new comment in their discussion, or increments a count in the main post.
  • The thread thus becomes a lightweight audit log for that user’s behavior.
  • Example:
    • Offense #1: +1 comment deleted at 2025-10-03 12:34 UTC
    • Offense #2: Another +1 posted on issue #123

Escalation to Temporary Bans

  • After N offenses, escalate to temporary restrictions (e.g. 1h ban → 1d ban → 1w ban).
  • Bans could be implemented using GitHub’s org block API with an auto-unblock workflow.
  • Teaching message can be embedded in the block notification, avoiding adding noise to public issues.

Implementation Details

GitHub Actions Workflow Sketch

  • Trigger: on: issue_comment
  • Detect trivial comment (^\s*\+1\s*$ or 👍 only).
  • Delete offending comment.
  • Create or update user’s moderator notice discussion.
  • Append new offense note (comment) or increment counter.
  • If thresholds reached, escalate to temporary ban.

API Calls (GraphQL / REST)

  • REST: Delete issue/PR comment.
  • GraphQL: Create/Update discussions, post replies, edit main body.
  • REST/GraphQL: Org block/unblock user for timed bans.

Locking and Category Isolation

  • Place all moderator notices in a separate category to avoid cluttering main discussions.
  • Lock discussions after moderator post so only moderators can comment.
  • Link to a canonical guidelines discussion for further reading / community feedback.

Limitations / Risks

  • Discussions are public; other users can see moderator notices for individuals.
  • If maintainers watch all discussions, they may still get notifications.
  • Creating many per-user discussions could clutter the category (requires periodic cleanup).
  • Blocking users removes collaboration privileges and may be heavy-handed.

Future Extensions

  • Smarter detection beyond “+1” (e.g. “me too”, “same here”).
  • Integrate with ML or heuristics for spam/noise.
  • Centralized dashboard of offenses across users.
  • Automated cooldowns with configurable ban lengths.

Manual Workarounds

In the meantime, this is the basic template I have used manually in threads where there tend to be a lot of +1 spam:

@User1 @User2 @UserEtc , anyone else who did it prior, and anyone else thinking of doing it in the future: Can we please not spam issues with +1, it's considered rude and noisy. It doesn't contribute to the issue, but it does needlessly ping everyone subscribed to it. If you want to show support for the issue getting fixed, click the 👍🏻 on the [original post](#TODO) instead.

**Further reading:**

- https://github.blog/news-insights/product-news/add-reactions-to-pull-requests-issues-and-comments/

See Also

My Other Related Deepdive Gist's and Projects

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