A GitHub action that detects and automatically closes low-quality and AI slop PRs.
A GitHub action that detects and automatically closes low-quality and AI slop PRs.
A GitHub Action that detects and automatically closes low-quality and AI slop PRs. It ships with 34 check rules covering PR branches, size, title, description, template, commit messages, file changes, user signals and contributor history.
Everything is configurable through 57 options including checks, exemptions and failure actions, that you do not have to touch if you don't want to, as we've set sensible defaults.
[!IMPORTANT] Anti Slop is currently v0 and subject to breaking changes prior to v1.0.0. Pin to a specific version or commit SHA if you need stability.
Open-source maintainers are drowning in low-quality and AI-generated slop PRs. These PRs undermine real contributions and waste reviewers time. Anti Slop stops these PRs before they reach your review queue.
max-failures threshold controls how many checks must fail before any actions are taken. The higher the number, the less likely a legitimate contributor is flagged.v0.2.0) and it is guaranteed immutable by GitHub - no convoluted SHA pinning needed but the same security benefits as if you pinned to a specific SHA.Add this workflow file .github/workflows/pr-quality.yaml:
name: PR Quality
permissions:
contents: read
issues: read
pull-requests: write
on:
pull_request_target:
types: [opened, reopened]
jobs:
anti-slop:
runs-on: ubuntu-latest
steps:
- uses: peakoss/anti-slop@v0
with:
max-failures: 4For the execution of this action it must be able to read the contents of pull requests and issues to run checks.
In addition based on additionally configured options (eg. comment, add label, remove label, etc.) the action could require more permissions.
We recommend the following permissions by default:
permissions:
contents: read
issues: read
pull-requests: writeYou can find more information about how to use permissions with GitHub Actions in the GitHub Actions documentation.
Below is a full example workflow file with every option and its default value so you can much faster configure the action to your needs.
Full Example Workflow
…The only required input is github-token and it is automatically set to the workflow's GITHUB_TOKEN by its default value.
| Input | Description | Default |
|---|---|---|
github-token |
GitHub token used to authenticate API requests. | ${{ github.token }} |
max-failures |
Number of check failures needed before failure actions are triggered. | 4 |
allowed-target-branches |
Newline-separated target branch patterns to allow. Empty allows all branches. | "" |
blocked-target-branches |
Newline-separated target branch patterns to block. | "" |
allowed-source-branches |
Newline-separated source branch patterns to allow. Empty allows all branches. | "" |
blocked-source-branches |
Newline-separated source branch patterns to block. | main, master |
max-changed-files |
Maximum number of changed files allowed in the PR. 0 disables this check. | 50 |
max-changed-lines |
Maximum number of changed lines (additions + deletions) allowed in the PR. 0 disables this check. | 10000 |
max-negative-reactions |
Maximum number of negative reactions (thumbs down + confused) allowed on the PR. 0 disables this check. | 0 |
require-maintainer-can-modify |
Require the PR to allow maintainers to push to the source branch. | true |
require-conventional-title |
Require PR titles to follow Conventional Commits format (e.g. 'feat:', 'fix:', 'feat(scope):'). | false |
require-description |
Require a non-empty PR description. | true |
max-description-length |
Maximum character length for the PR description. 0 disables this check. | 2500 |
max-emoji-count |
Maximum number of emojis allowed in the PR title and description. 0 disables this check. | 2 |
max-code-references |
Maximum number of code references (file paths, function/method calls) allowed in the PR description. 0 disables this check. | 5 |
require-linked-issue |
Require the PR to reference at least one issue in the PR description. | false |
blocked-terms |
Newline-separated list of terms blocked from appearing in the PR description. | "" |
blocked-issue-numbers |
Comma-separated list of issue numbers blocked from being referenced in the PR description. | "" |
require-pr-template |
Require the PR description to follow the repository PR template structure. | false |
strict-pr-template-sections |
Comma-separated PR template section headings (without '#') classified as strict. All checkboxes must be present and checked. Only applies when require-pr-template is ena |
No open issues yet, or sync has not completed.