fix(ci): 质量检查 - 修复增量格式检查 EPIPE 与连线代码格式

This commit is contained in:
ddCat
2026-09-20 09:34:46 +08:00
parent d7682963a4
commit 104396ba2f
4 changed files with 145 additions and 30 deletions

View File

@@ -78,30 +78,7 @@ jobs:
- name: Check formatting
env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
run: |
changed_files=()
repo_prefix="$(git rev-parse --show-prefix)"
while IFS= read -r -d '' file; do
case "$file" in
*.css|*.html|*.json|*.js|*.jsx|*.md|*.mdx|*.mjs|*.cjs|*.ts|*.tsx|*.yaml|*.yml)
base_path="${repo_prefix}${file}"
if git cat-file -e "$BASE_SHA:$base_path" 2>/dev/null \
&& ! diff -q \
<(git show "$BASE_SHA:$base_path") \
<(git show "$BASE_SHA:$base_path" | bunx prettier --ignore-path /dev/null --stdin-filepath "$file") \
>/dev/null; then
echo "Skipping legacy unformatted file: $file"
continue
fi
changed_files+=("$file")
;;
esac
done < <(git diff --relative --name-only --diff-filter=ACMR -z "$BASE_SHA" "$GITHUB_SHA" -- .)
if (( ${#changed_files[@]} > 0 )); then
bunx prettier --check "${changed_files[@]}"
else
echo "No changed web files require formatting checks."
fi
run: bun scripts/check-changed-formatting.mjs
- name: Typecheck
run: bun run typecheck
- name: Lint retired Ant Design APIs