English | 简体中文
AI-powered GitHub Action for detecting spam, low-quality issues, and suspicious pull requests. It can also classify valid issues and pull requests with repository labels.
- Detects spam and meaningless issues or pull requests
- Checks whether an issue is already fully answered by the README or pinned issues
- Requests more information for unclear bug reports
- Validates pull request titles and optionally inspects file changes
- Classifies valid issues and pull requests with configurable labels
- Handles HTTP content-filter errors, Responses API refusals, incomplete output, and failed response states explicitly
- Separates trusted detection instructions from untrusted issue, pull request, and repository content
- Supports GitHub Models and OpenAI-compatible API providers
- Supports English and Simplified Chinese bot responses
- Supports username blacklists
Create .github/workflows/nomore-spam.yml in your repository:
name: NoMore Spam
on:
issues:
types: [opened]
pull_request_target:
types: [opened]
permissions:
contents: read
issues: write
pull-requests: write
models: read
jobs:
spam-detection:
runs-on: ubuntu-latest
steps:
- name: Detect and close spam
uses: JohnsonRan/nomore-spam@main
with:
github-token: ${{ github.token }}Bot comments and generated answers use English by default. To use Simplified Chinese:
with:
github-token: ${{ github.token }}
language: zh-CN| Input | Description | Required | Default |
|---|---|---|---|
github-token |
GitHub token used to read repository content and manage issues or pull requests | Yes | ${{ github.token }} |
ai-model |
AI model name | No | openai/gpt-4o |
ai-base-url |
OpenAI-compatible API base URL. Omit to use GitHub Models | No | GitHub Models endpoint |
ai-api-key |
API key for a custom provider. Omit to use the GitHub token | No | Empty |
ai-api-type |
API interface: chat-completions or responses |
No | chat-completions |
labels |
Comma-separated labels available to AI classification | No | bug,enhancement,question |
language |
Bot response language: en or zh-CN |
No | en |
analyze-file-changes |
Include limited pull request file changes in analysis | No | true |
max-analysis-depth |
File analysis depth: light, normal, or deep |
No | normal |
blacklist |
Comma-separated GitHub usernames to close without AI analysis | No | Empty |
name: NoMore Spam
on:
issues:
types: [opened]
pull_request_target:
types: [opened]
permissions:
contents: read
issues: write
pull-requests: write
models: read
jobs:
spam-detection:
runs-on: ubuntu-latest
steps:
- name: Detect and close spam
uses: JohnsonRan/nomore-spam@main
with:
github-token: ${{ github.token }}
ai-base-url: ${{ secrets.AI_BASE_URL }}
ai-api-key: ${{ secrets.AI_API_KEY }}
ai-api-type: responses
ai-model: ${{ secrets.AI_MODEL }}
labels: 'bug,enhancement,question'
language: en
analyze-file-changes: 'true'
max-analysis-depth: normal
blacklist: ${{ secrets.BLACKLIST }}ai-base-url must be the provider's API base URL, not a full endpoint path. Use ai-api-type: responses for /responses; the default chat-completions uses /chat/completions. Responses requests set store: false so issue and pull request content is not retained for response state.
- Close blacklisted users immediately.
- Detect obvious spam or meaningless content.
- Check whether the README or pinned issues completely answer the issue.
- Classify valid issues using the configured labels.
- Run additional quality checks for bug-like classifications.
- Ask for missing information or close basic usage questions when applicable.
When an AI provider returns an explicit content-policy rejection such as content_filter, ResponsibleAIPolicyViolation, or a Responses API refusal, NoMore Spam adds a neutral explanation and closes the issue without locking it. Incomplete output caused by token limits, failed response states, and unrelated HTTP 400 responses remain normal action failures.
- Close blacklisted users immediately.
- Optionally collect a limited summary of changed files.
- Detect spam or meaningless content.
- Validate the pull request title.
- Check pull request quality and malicious or trivial changes.
- Classify valid pull requests using the configured labels.
language controls bot comments and AI-generated README answers:
en— English, defaultzh-CN— Simplified Chinese
Unsupported values fall back to English. Detection prompts and machine-readable decisions such as SPAM, VALID, and COVERED remain in English for stable parsing.
permissions:
contents: read
issues: write
pull-requests: write
models: readcontents: readreads the repository README.issues: writecomments on, labels, closes, and locks issues.pull-requests: writecomments on and closes pull requests.models: readaccesses GitHub Models when no custom provider is configured.