mirror of
https://github.com/lobehub/lobehub.git
synced 2026-09-20 04:56:13 +08:00
b52b991812
* ✨ feat(ci): auto-handle MCP marketplace submission issues Adds a workflow + script that auto-triages "Add my MCP server to the marketplace" issues, now that listing is self-service via @lobehub/market-cli. - Local/installable servers (npx/npm/uvx/pip/docker/stdio): post a CLI redirect comment (with the submitter's repo filled in) and close as not_planned; the comment invites reopen if mis-closed. - Remote-only servers (URL/SSE/streamable-http, no install): cannot use the CLI, so label mcp:remote and leave open for manual review. - Guardrails: skip marketplace pipeline/listing bugs and publishing-CLI feedback. - Silence the triage @-mention for these listing requests (marketplace bugs and product feature requests still get mentioned). * 🔨 chore(ci): convert invalid top-level workflow description keys to comments Top-level `description` is not part of the GitHub Actions workflow schema (it is only valid nested under workflow_call/workflow_dispatch inputs), so editors flag "Property description is not allowed". Convert these doc strings to # comments to clear the lint while keeping the text. No runtime change. * 🐛 fix(ci): harden MCP delivery detection per review - A bare `stdio` mention no longer outranks a remote signal, so a remote server that says "Transport: SSE, not stdio" is classified remote (labeled mcp:remote) instead of being closed with the local CLI redirect. - Recognize a bare endpoint URL (`URL:`/`Endpoint:` + non-GitHub https) as a remote reference, so URL-only submissions with no repo are labeled mcp:remote instead of falling through to normal triage. Precedence is now: remote-only > strong install (npx/npm/uvx/pip/docker/command) > remote signal > lone stdio mention.
75 lines
2.3 KiB
YAML
75 lines
2.3 KiB
YAML
name: Claude Auto Testing Coverage
|
|
# Automatically add unit tests to improve code coverage
|
|
|
|
on:
|
|
schedule:
|
|
# Run daily at 05:30 UTC (13:30 Beijing Time)
|
|
- cron: '30 5 * * *'
|
|
workflow_dispatch:
|
|
inputs:
|
|
target_module:
|
|
description: 'Specific module to add tests (e.g., packages/database, src/services/user)'
|
|
required: false
|
|
type: string
|
|
|
|
concurrency:
|
|
group: auto-testing
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
add-tests:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 45
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
id-token: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup environment
|
|
uses: ./.github/actions/setup-env
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config --global user.name "claude-bot[bot]"
|
|
git config --global user.email "claude-bot[bot]@users.noreply.github.com"
|
|
|
|
- name: Copy prompts
|
|
run: |
|
|
mkdir -p /tmp/claude-prompts
|
|
cp .claude/prompts/auto-testing.md /tmp/claude-prompts/
|
|
cp .claude/prompts/security-rules.md /tmp/claude-prompts/
|
|
|
|
- name: Run Claude Code for Auto Testing
|
|
uses: anthropics/claude-code-action@v1
|
|
with:
|
|
github_token: ${{ secrets.GH_TOKEN }}
|
|
allowed_non_write_users: '*'
|
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
claude_args: |
|
|
--allowedTools "Bash,Read,Edit,Write,Glob,Grep"
|
|
--append-system-prompt "$(cat /tmp/claude-prompts/security-rules.md)"
|
|
prompt: |
|
|
Follow the auto testing guide located at:
|
|
```bash
|
|
cat /tmp/claude-prompts/auto-testing.md
|
|
```
|
|
|
|
## Task Assignment
|
|
|
|
${{ inputs.target_module && format('Process the specified module: {0}', inputs.target_module) || 'Automatically select one module from the target directories that needs test coverage' }}
|
|
|
|
## Environment Information
|
|
- Repository: ${{ github.repository }}
|
|
- Branch: ${{ github.ref_name }}
|
|
- Target Module: ${{ inputs.target_module || 'Auto-select' }}
|
|
- Run ID: ${{ github.run_id }}
|
|
|
|
**Start the auto testing process now.**
|