diff --git a/.github/workflows/antislop.yml b/.github/workflows/antislop.yml new file mode 100644 index 00000000..1fea1f6c --- /dev/null +++ b/.github/workflows/antislop.yml @@ -0,0 +1,61 @@ +name: PR Quality + +on: + pull_request_target: + types: [opened, reopened, edited, synchronize] + +permissions: + contents: read + issues: read + pull-requests: write + +jobs: + anti-slop: + runs-on: ubuntu-latest + steps: + - uses: peakoss/anti-slop@85daca1880e9e1af197fc06ea03349daf08f4202 + with: + max-failures: 4 + + require-description: true + max-description-length: 2000 + max-emoji-count: 2 + max-code-references: 5 + + max-commit-message-length: 300 + require-commit-author-match: true + + min-account-age: 30 + min-profile-completeness: 4 + min-global-merge-ratio: 30 + + max-daily-forks: 7 + detect-spam-usernames: true + + blocked-source-branches: | + main + master + + blocked-terms: | + ignore previous instructions + you are a helpful AI + as an AI language model + + exempt-draft-prs: true + exempt-bots: | + dependabot[bot] + renovate[bot] + github-actions[bot] + exempt-author-association: OWNER,MEMBER,COLLABORATOR + + success-add-pr-labels: checked + failure-add-pr-labels: slop + + failure-pr-message: | + ⚠️ This pull request has been flagged by **Anti-Slop**. + Our automated checks detected patterns commonly associated with + low-quality or automated/AI submissions (failure count reached). + No automatic closure — a maintainer will review it. + If this is legitimate work, please add more context, link issues, or ping us. + + close-pr: false diff --git a/.github/workflows/auto-translate-zh.yml b/.github/workflows/auto-translate-zh.yml new file mode 100644 index 00000000..62846e9d --- /dev/null +++ b/.github/workflows/auto-translate-zh.yml @@ -0,0 +1,38 @@ +name: Auto Translate to zh-CN + +on: + push: + branches: [main] + paths: + - "*.md" + +permissions: + contents: write + models: read + +jobs: + translate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/cache@v4 + with: + path: .genaiscript/cache/** + key: translation-cache-${{ github.run_id }} + restore-keys: translation-cache- + + - uses: pelikhan/action-continuous-translation@v0.2.11 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + source: en + lang: zh + files: "*.md;README.md;CONTRIBUTING.md;TRANSLATION_GUIDE.md;CLAUDE.md" + filename_template: "{{ base }}.zh-CN{{ ext }}" + + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "docs(zh-CN): auto-translate updates" + file_pattern: "*.zh-CN.md"