Anti-Slop workflow (huggingface/transformers)
The Anti-Slop workflow from huggingface/transformers, explained and optimized by Latchkey.
A
CI health: A - excellent
Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the Anti-Slop workflow from the huggingface/transformers repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
workflow (.yml)
name: Anti-Slop
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@57858eead489d08b255fab2af45a506c2ca6eab2 # v0.3.0
with:
# -- Failure threshold --
# Require both enabled checks to fail before labeling while we validate the signals
max-failures: 2
# -- Do NOT close or lock, just label --
close-pr: false
lock-pr: false
failure-add-pr-labels: "Code agent slop"
failure-pr-message: |
This PR was flagged by our automated quality checks. If you're a genuine
contributor, please reply here and a maintainer will review your PR.
Common reasons for flagging:
- New GitHub account
- Unusually high number of repository forks in a 24-hour window
We appreciate your contribution and apologize if this is a false positive!
# -- Account checks --
# Start with two conservative, high-signal checks and iterate from there
min-account-age: 30
max-daily-forks: 7
# -- Disabled checks (keep minimal) --
blocked-source-branches: ""
blocked-paths: ""
detect-spam-usernames: false
min-profile-completeness: 0
require-description: false
require-linked-issue: false
require-conventional-title: false
require-pr-template: false
strict-pr-template-sections: ""
optional-pr-template-sections: ""
max-additional-pr-template-sections: 0
max-description-length: 0
require-conventional-commits: false
require-commit-author-match: false
require-maintainer-can-modify: false
require-final-newline: false
max-added-comments: 0
max-emoji-count: 0
max-code-references: 0
max-commit-message-length: 0
min-repo-merged-prs: 0
min-repo-merge-ratio: 0
min-global-merge-ratio: 0
# -- Exemptions --
exempt-author-association: "OWNER,MEMBER,COLLABORATOR"
exempt-label: "exempt"
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: Anti-Slop permissions: contents: read issues: read pull-requests: write on: pull_request_target: types: [opened, reopened] jobs: anti-slop: timeout-minutes: 30 runs-on: latchkey-small steps: - uses: peakoss/anti-slop@57858eead489d08b255fab2af45a506c2ca6eab2 # v0.3.0 with: # -- Failure threshold -- # Require both enabled checks to fail before labeling while we validate the signals max-failures: 2 # -- Do NOT close or lock, just label -- close-pr: false lock-pr: false failure-add-pr-labels: "Code agent slop" failure-pr-message: | This PR was flagged by our automated quality checks. If you're a genuine contributor, please reply here and a maintainer will review your PR. Common reasons for flagging: - New GitHub account - Unusually high number of repository forks in a 24-hour window We appreciate your contribution and apologize if this is a false positive! # -- Account checks -- # Start with two conservative, high-signal checks and iterate from there min-account-age: 30 max-daily-forks: 7 # -- Disabled checks (keep minimal) -- blocked-source-branches: "" blocked-paths: "" detect-spam-usernames: false min-profile-completeness: 0 require-description: false require-linked-issue: false require-conventional-title: false require-pr-template: false strict-pr-template-sections: "" optional-pr-template-sections: "" max-additional-pr-template-sections: 0 max-description-length: 0 require-conventional-commits: false require-commit-author-match: false require-maintainer-can-modify: false require-final-newline: false max-added-comments: 0 max-emoji-count: 0 max-code-references: 0 max-commit-message-length: 0 min-repo-merged-prs: 0 min-repo-merge-ratio: 0 min-global-merge-ratio: 0 # -- Exemptions -- exempt-author-association: "OWNER,MEMBER,COLLABORATOR" exempt-label: "exempt"
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Add a job timeout so a hung step cannot burn hours of runner time.
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.