ci(workflow): 添加获取所有分支的步骤以同步镜像仓库

确保在同步镜像仓库时能够获取所有远程分支,而不仅仅是默认分支
This commit is contained in:
辉鸭蛋
2025-09-05 02:08:03 +08:00
parent 60e3d30e5b
commit a2b2fd8252

View File

@@ -20,6 +20,11 @@ jobs:
fetch-depth: 0 # 获取完整的git历史记录
token: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch all branches
run: |
git fetch --all
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote" 2>/dev/null || true; done
- name: Set up Git
run: |
git config --global user.name "github-actions[bot]"