Skip to content

ci: add on-slop workflow to auto-close flagged AI PRs - #229

Merged
allxsmith merged 1 commit into
mainfrom
claude/on-slop-guardrail
Jul 6, 2026
Merged

allxsmith merged 1 commit into
mainfrom
claude/on-slop-guardrail

Conversation

@allxsmith

@allxsmith allxsmith commented Jul 6, 2026 •

Copy link
Copy Markdown
Owner

Description

Item 2 of 3 — a one-click human kill switch for low-quality AI PRs, mirroring oven-sh/bun's on-slop.yml.

When a triage+ maintainer applies the slop label to an open PR, this workflow:

  1. re-verifies the labeler has triage+ (defensive; GitHub already restricts labeling),
  2. posts a standardized message citing the common AI-PR failure modes (didn't verify the problem exists / didn't test the fix / bad assumptions),
  3. strips the loop labels and closes the PR.

It never checks out PR code, so pull_request_target is safe.

Affected package(s):

  • Other: CI / GitHub Actions (.github/workflows/on-slop.yml)

Related Issue(s)

Refs #188

Type of Change

  • Build tooling

⚠️ Required setup (human, one-time)

Create a slop label in the repo (Issues → Labels → New label) — e.g. color #b60205, description "Low-quality AI-generated PR; auto-closed by on-slop.yml". Until the label exists, there's nothing to apply and the workflow simply never fires (safe no-op). GitHub will also auto-create it the first time you type slop in the label picker.

Checklist

  • Self-reviewed; YAML validated (pull_request_target labeled → single close job)
  • Least-privilege: pull-requests: write + issues: write only; no code checkout
  • Triage-gated so an automated/template label can't trigger an auto-close

🤖 Generated with Claude Code

https://claude.ai/code/session_01NVR5yWevceZEFbTJmpviiM


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Added automated handling for pull requests marked with a specific review label.
    • Eligible pull requests now receive a standardized comment and may be closed automatically when flagged.
    • The process now checks that the label was added by a human and only acts on open pull requests.
    • Related review labels are removed before the pull request is closed.

Mirrors oven-sh/bun's on-slop.yml: when a triage+ maintainer applies the
`slop` label to a PR, post a standardized explanation (didn't verify the
problem exists / didn't test the fix / bad assumptions) and close it,
stripping the loop labels. A one-click human kill switch for low-quality
AI-generated PRs. Never checks out PR code, so pull_request_target is
safe; the labeler's triage role is re-verified defensively.

Requires a `slop` label to exist in the repo (created separately).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NVR5yWevceZEFbTJmpviiM
@allxsmith
allxsmith merged commit 6a15342 into main Jul 6, 2026
7 of 8 checks passed
@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5c0aa193-ea06-484d-b4e2-d00838b4a7de

📥 Commits

Reviewing files that changed from the base of the PR and between b0e323d and 36de1f2.

📒 Files selected for processing (1)
  • .github/workflows/on-slop.yml

Walkthrough

Adds a new GitHub Actions workflow, on-slop.yml, triggered on pull_request_target when a PR is labeled slop. It verifies the labeler's collaborator role via GitHub CLI, and if triage+ and the PR is open, posts a comment, removes loop-related labels, and closes the PR.

Changes

On Slop GitHub Action

Layer / File(s) Summary
Slop label workflow
.github/workflows/on-slop.yml
New workflow scoped per-PR that fires on the slop label event, verifies the labeler has triage+ collaborator permission via gh api, posts a standardized comment, removes ai-loop, ai-loop-paused, and needs-human-review labels, and closes the PR if still open.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Labeler
  participant GitHubActions as On Slop Workflow
  participant GitHubAPI

  Labeler->>GitHubActions: Apply "slop" label to PR
  GitHubActions->>GitHubAPI: Check labeler collaborator role
  GitHubAPI-->>GitHubActions: Return role
  alt Role below triage
    GitHubActions->>GitHubActions: Exit without action
  else Role triage or above, PR open
    GitHubActions->>GitHubAPI: Post explanatory comment
    GitHubActions->>GitHubAPI: Remove ai-loop related labels
    GitHubActions->>GitHubAPI: Close PR
  end
Loading

Related issues: None referenced.

Suggested labels: ci, github-actions

Suggested reviewers: None identified from available context.

🐰 A label named "slop" appears on the scene,
The bot checks who's behind the machine,
If triage rank is met with grace,
It comments once, then clears the space,
And closes doors on AI's routine.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/on-slop-guardrail

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Preview Deployment

Preview URL: https://857c4a79.bestax.pages.dev

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants