From d33b4ffee80e411a81082104cb989d85d662c52a Mon Sep 17 00:00:00 2001 From: pooneyy <85266337+pooneyy@users.noreply.github.com> Date: Tue, 3 Mar 2026 00:03:17 +0800 Subject: [PATCH] ci(sync): optimize synchronization workflow using mirror push - replace separate branch and tag pushes with single `git push --mirror` command - update echo messages to reflect simplified synchronization process --- .github/workflows/sync.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index f55997468..9a2adf73d 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -75,10 +75,8 @@ jobs: - name: 强制推送所有分支和所有标签到 ${{ matrix.remote.name }} run: | - echo "将所有分支推送到 ${{ matrix.remote.name }} (修剪模式)..." - git push --force --prune ${{ matrix.remote.name }} --all - echo "将所有 tags 推送到 ${{ matrix.remote.name }}..." - git push --force ${{ matrix.remote.name }} --tags + echo "将仓库同步到 ${{ matrix.remote.name }}..." + git push --mirror ${{ matrix.remote.name }} - name: 记录成功摘要 if: success() @@ -134,10 +132,8 @@ jobs: - name: 强制推送所有分支和所有标签到 ${{ matrix.remote.name }} run: | - echo "将所有分支推送到 ${{ matrix.remote.name }} (修剪模式)..." - git push --force --prune ${{ matrix.remote.name }} --all - echo "将所有 tags 推送到 ${{ matrix.remote.name }}..." - git push --force ${{ matrix.remote.name }} --tags + echo "将仓库同步到 ${{ matrix.remote.name }}..." + git push --mirror ${{ matrix.remote.name }} - name: 记录成功摘要 if: success()