-
Notifications
You must be signed in to change notification settings - Fork 54
chore: add anti-slop protection for AI-generated spam PRs #642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+114
−0
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| name: anti-slop | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: [opened, reopened] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| issues: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| anti-slop: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: peakoss/anti-slop@v0 | ||
| with: | ||
| # --- Failure threshold --- | ||
| # Close PR after 4+ failed checks (default) | ||
| max-failures: 4 | ||
|
|
||
| # --- Exemptions --- | ||
| # OWNER, MEMBER, COLLABORATOR are exempt by default. | ||
| # Also exempt our CI bots: | ||
| exempt-bots: | | ||
| actions-user | ||
| dependabot[bot] | ||
| renovate[bot] | ||
| github-actions[bot] | ||
| opencode-agent[bot] | ||
|
|
||
| # --- PR quality --- | ||
| require-description: true | ||
| require-maintainer-can-modify: true | ||
|
|
||
| # --- PR title --- | ||
| # We already enforce conventional commits in pr-standards.yml, | ||
| # but this adds a second layer for the anti-slop score: | ||
| require-conventional-title: true | ||
|
|
||
| # --- PR description --- | ||
| max-description-length: 5000 | ||
| max-emoji-count: 3 | ||
| max-code-references: 10 | ||
| require-linked-issue: false # Already enforced in pr-standards.yml | ||
|
|
||
| # --- Honeypot trap --- | ||
| # AI agents follow hidden instructions; humans ignore them. | ||
| # The matching instruction is embedded in pull_request_template.md. | ||
| blocked-terms: "PINEAPPLE" | ||
|
|
||
| # --- Commit checks --- | ||
| max-commit-message-length: 500 | ||
| require-conventional-commits: false # Only title is enforced | ||
| require-commit-author-match: false # We use Co-Authored-By: Claude | ||
|
|
||
| # --- File checks --- | ||
| blocked-paths: | | ||
| LICENSE | ||
| CODE_OF_CONDUCT.md | ||
| SECURITY.md | ||
| require-final-newline: true | ||
| max-added-comments: 0 # Disable — legitimate PRs often add comments | ||
|
|
||
| # --- User signal checks (the main anti-slop value) --- | ||
| detect-spam-usernames: true | ||
| min-account-age: 30 | ||
| max-daily-forks: 5 | ||
| min-profile-completeness: 3 | ||
|
|
||
| # --- Merge history checks --- | ||
| min-global-merge-ratio: 25 | ||
|
|
||
| # --- Branch checks --- | ||
| blocked-source-branches: | | ||
| main | ||
| master | ||
|
|
||
| # --- Actions on failure --- | ||
| close-pr: true | ||
| lock-pr: false | ||
| failure-add-pr-labels: "needs-review:blocked" | ||
| failure-pr-message: | | ||
| 👋 This PR was automatically closed by our quality checks. | ||
|
|
||
| Common reasons: | ||
| - New GitHub account with limited contribution history | ||
| - PR description doesn't meet our guidelines | ||
| - Contribution appears to be AI-generated without meaningful review | ||
|
|
||
| If you believe this was a mistake, please open an issue explaining your intended contribution and a maintainer will help you. | ||
|
|
||
| # --- Actions on success --- | ||
| success-add-pr-labels: "" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.