mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-07-23 04:03:48 +08:00
## Summary - 将 dashscope-image-gen、image-to-image、markdown、tech-diagram、xiaomi-tts 改为仅按需加载,并递增 patch 版本 - 在 Market validator 与 JSON Schema 中禁止 `disable-model-invocation: false` - 将回归测试接入 `i18n Validate`,同步中英文技能编写规范 ## Root cause and impact 这 5 个技能在首次引入时即声明 `disable-model-invocation: false`,导致完整技能正文进入普通请求的 system prompt。修改后市场技能只能声明 `true` 或省略该字段,完整内容仅在显式调用 Skill 工具后加载。 ## Validation - `uv run --quiet scripts/i18n/test_validate_i18n.py` - `uv run --quiet scripts/i18n/validate-i18n.py` - `uv run --quiet scripts/i18n/translate.py --check` - `python3 -m json.tool scripts/i18n/schema/skill-frontmatter.schema.json` - `actionlint .github/workflows/i18n-validate.yml` - `git diff --check`
76 lines
2.3 KiB
YAML
76 lines
2.3 KiB
YAML
name: i18n Validate
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
validate:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Detect relevant changes
|
|
id: changes
|
|
env:
|
|
EVENT_NAME: ${{ github.event_name }}
|
|
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
PUSH_BEFORE: ${{ github.event.before }}
|
|
PUSH_AFTER: ${{ github.event.after }}
|
|
run: |
|
|
set -e
|
|
case "$EVENT_NAME" in
|
|
pull_request)
|
|
git fetch --no-tags --depth=1 origin "$BASE_SHA" 2>/dev/null || true
|
|
range="${BASE_SHA}...${HEAD_SHA}"
|
|
;;
|
|
push)
|
|
if [ -n "$PUSH_BEFORE" ] && [ "$PUSH_BEFORE" != "0000000000000000000000000000000000000000" ]; then
|
|
range="${PUSH_BEFORE}...${PUSH_AFTER}"
|
|
else
|
|
# initial push or unknown before — assume relevant
|
|
echo "relevant=true" >> "$GITHUB_OUTPUT"
|
|
exit 0
|
|
fi
|
|
;;
|
|
*)
|
|
echo "relevant=true" >> "$GITHUB_OUTPUT"
|
|
exit 0
|
|
;;
|
|
esac
|
|
changed=$(git diff --name-only "$range" || true)
|
|
if echo "$changed" | grep -qE '^(skills/|agents/|manifest\.json$|categories\.json$|scripts/i18n/)'; then
|
|
echo "relevant=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "relevant=false" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Install uv
|
|
if: steps.changes.outputs.relevant == 'true'
|
|
uses: astral-sh/setup-uv@v3
|
|
|
|
- name: Run validator unit tests
|
|
if: steps.changes.outputs.relevant == 'true'
|
|
run: uv run --quiet scripts/i18n/test_validate_i18n.py
|
|
|
|
- name: Validate i18n
|
|
if: steps.changes.outputs.relevant == 'true'
|
|
run: uv run --quiet scripts/i18n/validate-i18n.py
|
|
|
|
- name: Check for stale translations
|
|
if: steps.changes.outputs.relevant == 'true'
|
|
run: uv run --quiet scripts/i18n/translate.py --check
|
|
|
|
- name: Skip notice
|
|
if: steps.changes.outputs.relevant != 'true'
|
|
run: echo "No i18n-relevant changes; validation skipped."
|