From 7e3671c06bc516aa38e9778171970317cae1f25e Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Fri, 7 Aug 2026 21:07:58 +0800 Subject: [PATCH] fix(ci): prevent auto-format bot from committing entire repository - Add git clean -fd before git add to remove untracked files - Change git add -A to git add -u to only stage tracked files - Fixes issue where shallow clone + tarball extraction leaves untracked files that get incorrectly included in auto-format commits Fixes auto-format bot shallow clone issue --- scripts/ci/auto_fix_formatting.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/ci/auto_fix_formatting.py b/scripts/ci/auto_fix_formatting.py index bc32c5308..95d573b8c 100755 --- a/scripts/ci/auto_fix_formatting.py +++ b/scripts/ci/auto_fix_formatting.py @@ -332,7 +332,8 @@ def main(): print(f" {line}") # 提交修复 - run("git add -A") + run("git clean -fd") + run("git add -u") run('git commit -m "style: auto-format with black + isort + prettier [skip ci-format-check]"') # 推送(head_branch已从ensure_git_repo获取) @@ -385,4 +386,4 @@ def main(): if __name__ == "__main__": - main() + main() \ No newline at end of file