🐛 fix(ci): update tests for flag-only scripts

This commit is contained in:
csh 2026-01-21 17:20:43 +08:00
parent c44b9aa4bb
commit 3ae970885d
4 changed files with 10 additions and 8 deletions

View File

@ -202,8 +202,8 @@ jobs:
tar -C "$REPO_DIR" --exclude .git -cf - . | tar -C docs/standards/playbook -xf - tar -C "$REPO_DIR" --exclude .git -cf - . | tar -C docs/standards/playbook -xf -
# 运行同步脚本 # 运行同步脚本
echo "▶ 运行 sync_standards.sh tsl" echo "▶ 运行 sync_standards.sh -langs tsl"
sh docs/standards/playbook/scripts/sync_standards.sh tsl sh docs/standards/playbook/scripts/sync_standards.sh -langs tsl
# 验证结果 # 验证结果
if [ -d ".agents/tsl" ] && [ -f ".agents/tsl/index.md" ]; then if [ -d ".agents/tsl" ] && [ -f ".agents/tsl/index.md" ]; then
@ -237,8 +237,8 @@ jobs:
mkdir -p docs/standards/playbook mkdir -p docs/standards/playbook
tar -C "$REPO_DIR" --exclude .git -cf - . | tar -C docs/standards/playbook -xf - tar -C "$REPO_DIR" --exclude .git -cf - . | tar -C docs/standards/playbook -xf -
echo "▶ 运行 sync_standards.sh cpp" echo "▶ 运行 sync_standards.sh -langs cpp"
sh docs/standards/playbook/scripts/sync_standards.sh cpp sh docs/standards/playbook/scripts/sync_standards.sh -langs cpp
if [ -d ".agents/cpp" ] && [ -f ".agents/cpp/index.md" ]; then if [ -d ".agents/cpp" ] && [ -f ".agents/cpp/index.md" ]; then
echo "✅ C++ 规则集同步成功" echo "✅ C++ 规则集同步成功"
@ -261,8 +261,8 @@ jobs:
mkdir -p docs/standards/playbook mkdir -p docs/standards/playbook
tar -C "$REPO_DIR" --exclude .git -cf - . | tar -C docs/standards/playbook -xf - tar -C "$REPO_DIR" --exclude .git -cf - . | tar -C docs/standards/playbook -xf -
echo "▶ 运行 sync_standards.sh tsl cpp" echo "▶ 运行 sync_standards.sh -langs tsl,cpp"
sh docs/standards/playbook/scripts/sync_standards.sh tsl cpp sh docs/standards/playbook/scripts/sync_standards.sh -langs tsl,cpp
if [ -d ".agents/tsl" ] && [ -d ".agents/cpp" ] && [ -f ".agents/index.md" ]; then if [ -d ".agents/tsl" ] && [ -d ".agents/cpp" ] && [ -f ".agents/index.md" ]; then
echo "✅ 多语言规则集同步成功" echo "✅ 多语言规则集同步成功"
@ -285,7 +285,7 @@ jobs:
git config user.email "test@example.com" git config user.email "test@example.com"
echo "▶ 运行 vendor_playbook.sh" echo "▶ 运行 vendor_playbook.sh"
sh "$REPO_DIR/scripts/vendor_playbook.sh" . tsl sh "$REPO_DIR/scripts/vendor_playbook.sh" -project-root . -langs tsl
if [ -d "docs/standards/playbook" ] && [ -d "docs/standards/playbook/rulesets/tsl" ] && [ -d ".agents/tsl" ]; then if [ -d "docs/standards/playbook" ] && [ -d "docs/standards/playbook/rulesets/tsl" ] && [ -d ".agents/tsl" ]; then
echo "✅ vendor_playbook 脚本执行成功" echo "✅ vendor_playbook 脚本执行成功"

View File

@ -207,6 +207,7 @@ set "AGENTS_BLOCK_START=<!-- playbook:agents:start -->"
set "AGENTS_BLOCK_END=<!-- playbook:agents:end -->" set "AGENTS_BLOCK_END=<!-- playbook:agents:end -->"
set "AGENTS_BLOCK_FILE=%ROOT%\.agents_block.!RANDOM!.tmp" set "AGENTS_BLOCK_FILE=%ROOT%\.agents_block.!RANDOM!.tmp"
> "%AGENTS_BLOCK_FILE%" echo %AGENTS_BLOCK_START% > "%AGENTS_BLOCK_FILE%" echo %AGENTS_BLOCK_START%
>> "%AGENTS_BLOCK_FILE%" echo.
>> "%AGENTS_BLOCK_FILE%" echo 请以 `.agents/` 下的规则为准: >> "%AGENTS_BLOCK_FILE%" echo 请以 `.agents/` 下的规则为准:
>> "%AGENTS_BLOCK_FILE%" echo. >> "%AGENTS_BLOCK_FILE%" echo.
>> "%AGENTS_BLOCK_FILE%" echo - 入口:`.agents/index.md` >> "%AGENTS_BLOCK_FILE%" echo - 入口:`.agents/index.md`

View File

@ -183,6 +183,7 @@ if ($agentsLangs.Count -eq 0) { $agentsLangs = @($AgentsNs) }
$langsLine = ($agentsLangs | ForEach-Object { "`.agents/$_/index.md`" }) -join "" $langsLine = ($agentsLangs | ForEach-Object { "`.agents/$_/index.md`" }) -join ""
$agentsBlock = @" $agentsBlock = @"
<!-- playbook:agents:start --> <!-- playbook:agents:start -->
请以 `.agents/` 下的规则为准 请以 `.agents/` 下的规则为准
- 入口`.agents/index.md` - 入口`.agents/index.md`

View File

@ -224,7 +224,7 @@ for name in $agents_langs; do
done done
{ {
printf "%s\n" "$AGENTS_BLOCK_START" printf "%s\n\n" "$AGENTS_BLOCK_START"
printf "%s\n\n" '请以 `.agents/` 下的规则为准:' printf "%s\n\n" '请以 `.agents/` 下的规则为准:'
printf "%s\n" '- 入口:`.agents/index.md`' printf "%s\n" '- 入口:`.agents/index.md`'
if [ -n "$langs_line" ]; then if [ -n "$langs_line" ]; then