Skip to content

Commit 05109fa

Browse files
authored
chore: add anti-slop PR screening workflow (#81)
* chore: add anti-slop PR quality workflow * docs: add required PR template and screening guidance * chore: pin anti-slop action to full SHA * chore: document PR workflow guardrails * docs: clarify anti-slop maintainer guardrails * chore: tighten anti-slop canary handling * fix: avoid canary token in PR template body * fix: rerun PR quality on label changes * fix: remove PR template canary hint * fix: protect PR screening files --------- Co-authored-by: ndycode <ndycode@users.noreply.github.com>
1 parent ce086c4 commit 05109fa

3 files changed

Lines changed: 85 additions & 1 deletion

File tree

.github/pull_request_template.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Maintainer note: the anti-slop canary token is configured in .github/workflows/pr-quality.yml under blocked-terms. Keep the template and workflow in sync, and do not put the raw token in contributor-facing files. -->
2+
3+
## Summary
4+
5+
- What changed?
6+
- Why is this needed?
7+
8+
## Testing
9+
10+
- [ ] `npm run lint`
11+
- [ ] `npm run build`
12+
- [ ] `npm test`
13+
- [ ] Not applicable
14+
15+
## Compliance Confirmation
16+
17+
- [ ] This change stays within the repository scope and OpenAI Terms of Service expectations.
18+
- [ ] This change uses official authentication flows only and does not add bypass, scraping, or credential-sharing behavior.
19+
- [ ] I updated tests and documentation when the change affected users, maintainers, or repository behavior.
20+
21+
## Notes
22+
23+
- Linked issue:
24+
- Follow-up work or rollout notes:

.github/workflows/pr-quality.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: PR Quality
2+
3+
permissions:
4+
contents: read
5+
issues: read
6+
pull-requests: write
7+
8+
on:
9+
# Use pull_request_target so the action can comment on fork PRs without
10+
# checking out or executing contributor code from the PR branch.
11+
pull_request_target:
12+
types:
13+
- opened
14+
- reopened
15+
- synchronize
16+
- edited
17+
- ready_for_review
18+
- labeled
19+
- unlabeled
20+
21+
jobs:
22+
anti-slop:
23+
runs-on: ubuntu-latest
24+
concurrency:
25+
group: pr-quality-${{ github.event.pull_request.number }}
26+
cancel-in-progress: true
27+
steps:
28+
- name: Screen pull request quality
29+
uses: peakoss/anti-slop@85daca1880e9e1af197fc06ea03349daf08f4202 # v0.2.1
30+
with:
31+
max-failures: 1
32+
require-pr-template: true
33+
# Keep this public canary aligned with the hidden template note below.
34+
# It is best-effort only, so rotate it if it becomes noisy or stale.
35+
blocked-terms: |
36+
OBSIDIAN1455
37+
# anti-slop documents exact file and folder entries here, so this
38+
# list guards the canonical metadata files and PR screening surfaces.
39+
blocked-paths: |
40+
SECURITY.md
41+
LICENSE
42+
CODE_OF_CONDUCT.md
43+
CODEOWNERS
44+
.github/workflows/pr-quality.yml
45+
.github/pull_request_template.md
46+
exempt-label: exempt
47+
exempt-draft-prs: true
48+
close-pr: false
49+
lock-pr: false
50+
failure-pr-message: |
51+
Thanks for the contribution. This repository automatically screens pull requests for incomplete, low-signal, or non-compliant submissions before maintainers spend review time.
52+
53+
Please review CONTRIBUTING.md, complete the PR template with concrete summary and testing details, and update the PR if anything important is missing.
54+
55+
If this looks like a false positive, a maintainer can override the workflow with the `exempt` label after review.

CONTRIBUTING.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,12 @@ The project does not accept work aimed at:
6464
4. **Update documentation** (README.md, config examples, etc.)
6565
5. **Ensure compliance** with guidelines above
6666
6. **Test thoroughly** with the most appropriate validation for the change
67-
7. **Submit PR** with clear description of changes
67+
7. **Complete the pull request template** with summary, testing, and compliance details
68+
8. **Submit PR** with clear description of changes
69+
70+
Pull requests are automatically screened for incomplete or suspicious submissions. Legitimate contributions are still welcome, but low-signal PRs may be flagged for maintainer review before they move forward.
71+
72+
If a PR is flagged incorrectly, a maintainer can override the workflow with the `exempt` label after review.
6873

6974
## Reporting Issues
7075

0 commit comments

Comments
 (0)