Automatically detect and label potential spam pull requests

The Problem

⚠️

Spam PRs

Malicious or low-effort pull requests with minimal changes can clutter repositories and waste maintainer time.

⏰

Manual Review

Manually reviewing every PR to identify potential spam is time-consuming and inconsistent.

🔍

Pattern Recognition

Spam PRs often have very few changes (1-2 lines) but legitimate PRs can vary widely in size.

The Solution

Automated Detection

AntiSpam PR Labeler automatically analyzes pull requests and flags those with suspiciously few changes as "Potential Spam".

✅ Automatic labeling based on change count
💬 Adds explanatory comments
⚙️ Configurable threshold (default: 2 changes)
🔧 Easy GitHub Actions integration
Example Pull Request Potential Spam
+1 addition -0 deletions
💬 This PR has been automatically labeled as "Potential Spam" due to its size. Please review.

🚀 See It In Action

Check out real examples of the AntiSpam PR Labeler working in a live repository

Real-World Implementation

Visit our test repository to see the AntiSpam PR Labeler in action! You can see:

🔍
Automatic Detection

Real PRs being automatically flagged as potential spam

💬
Smart Comments

Helpful explanatory comments added to flagged PRs

🏷️
Clear Labels

"Potential Spam" labels for easy identification

github.com/PraiseXI/spam-test-repo
🔄 Fix typo in README Potential Spam
🔄 Update version number Potential Spam
✅ Add new feature implementation enhancement

Try It Yourself

Enter PR details to see if it would be flagged as potential spam

🔍

Enter PR details to see the result

🚀 Ready to Get Started?

AntiSpam PR Labeler is available on the GitHub Marketplace - install it in seconds!

🏪
Install from GitHub Marketplace Free • Easy Setup • Instant Results

How to Use

1

Setup Permissions

Enable "Read and write permissions" in your repository's Actions settings.

2

Add to Workflow

Create a workflow file in .github/workflows/ directory.

3

Configure Action

Use the action with your desired settings and thresholds.

Example Workflow
name: Automate PR Labeling

on: [pull_request]

jobs:
  label-and-comment:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v2

    - name: Label and Comment PRs
      uses: PraiseXI/AntiSpamPRLabeler@v1.2.0
      with:
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        max-changes-for-label: '2'
        label-message: 'This PR has been automatically labeled as "Potential Spam" due to its size. Please review.'