Skip to content

randhana/pr-spam-shield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PR Spam Shield

A GitHub Action that automatically detects spammy or low-quality pull requests using rule-based heuristics and optionally flags them using labels or comments.


Features

  • Detects PRs that:
    • Have very small or meaningless changes.
    • Modify only documentation files.
    • Have generic commit titles (like "update" or "fix").
    • Lack a clear description.
  • Automatically labels suspicious PRs as spam.
  • Posts a comment to notify the contributor.

Installation

Add this workflow to your repository:

# .github/workflows/pr-spam-shield.yml
name: PR Spam Shield
on:
  pull_request:
    types: [opened, edited, reopened]

jobs:
  analyze:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Run Spam Shield
        run: python .github/scripts/pr_analyzer.py
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PR_NUMBER: ${{ github.event.pull_request.number }}
          REPO: ${{ github.repository }}

About

Automatically detects spammy or low-quality pull requests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors