Automatically detect and label potential spam pull requests
Malicious or low-effort pull requests with minimal changes can clutter repositories and waste maintainer time.
Manually reviewing every PR to identify potential spam is time-consuming and inconsistent.
Spam PRs often have very few changes (1-2 lines) but legitimate PRs can vary widely in size.
AntiSpam PR Labeler automatically analyzes pull requests and flags those with suspiciously few changes as "Potential Spam".
Check out real examples of the AntiSpam PR Labeler working in a live repository
Visit our test repository to see the AntiSpam PR Labeler in action! You can see:
Real PRs being automatically flagged as potential spam
Helpful explanatory comments added to flagged PRs
"Potential Spam" labels for easy identification
Enter PR details to see if it would be flagged as potential spam
AntiSpam PR Labeler is available on the GitHub Marketplace - install it in seconds!
Enable "Read and write permissions" in your repository's Actions settings.
Create a workflow file in .github/workflows/
directory.
Use the action with your desired settings and thresholds.
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.'