From 8b1db7bc1e35a6b5daf4d31b688325babd4d447b Mon Sep 17 00:00:00 2001 From: pooneyy <85266337+pooneyy@users.noreply.github.com> Date: Sat, 7 Mar 2026 03:05:18 +0800 Subject: [PATCH] ci(sync): replace git push --mirror with explicit force push commands - replace `git push --mirror` with `git push --force --all --prune` and `git push --force --tags` - update sync-auto.yml and sync-schedule.yml workflows - improve control over branch and tag synchronization - gitLab rejects refs that start with origin/, so the --mirror option is no longer used for pushing. Therefore, it has been reverted to using git push --force --all --prune followed by git push --force --tags. --- .github/workflows/sync-auto.yml | 6 ++++-- .github/workflows/sync-schedule.yml | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sync-auto.yml b/.github/workflows/sync-auto.yml index 9a2adf73d..46238efbe 100644 --- a/.github/workflows/sync-auto.yml +++ b/.github/workflows/sync-auto.yml @@ -76,7 +76,8 @@ jobs: - name: 强制推送所有分支和所有标签到 ${{ matrix.remote.name }} run: | echo "将仓库同步到 ${{ matrix.remote.name }}..." - git push --mirror ${{ matrix.remote.name }} + git push --force --all --prune ${{ matrix.remote.name }} + git push --force --tags ${{ matrix.remote.name }} - name: 记录成功摘要 if: success() @@ -133,7 +134,8 @@ jobs: - name: 强制推送所有分支和所有标签到 ${{ matrix.remote.name }} run: | echo "将仓库同步到 ${{ matrix.remote.name }}..." - git push --mirror ${{ matrix.remote.name }} + git push --force --all --prune ${{ matrix.remote.name }} + git push --force --tags ${{ matrix.remote.name }} - name: 记录成功摘要 if: success() diff --git a/.github/workflows/sync-schedule.yml b/.github/workflows/sync-schedule.yml index 671298758..31af6a126 100644 --- a/.github/workflows/sync-schedule.yml +++ b/.github/workflows/sync-schedule.yml @@ -66,7 +66,8 @@ jobs: - name: 强制推送所有分支和所有标签到 ${{ matrix.remote.name }} run: | echo "将仓库同步到 ${{ matrix.remote.name }}..." - git push --mirror ${{ matrix.remote.name }} + git push --force --all --prune ${{ matrix.remote.name }} + git push --force --tags ${{ matrix.remote.name }} - name: 记录成功摘要 if: success() @@ -122,7 +123,8 @@ jobs: - name: 强制推送所有分支和所有标签到 ${{ matrix.remote.name }} run: | echo "将仓库同步到 ${{ matrix.remote.name }}..." - git push --mirror ${{ matrix.remote.name }} + git push --force --all --prune ${{ matrix.remote.name }} + git push --force --tags ${{ matrix.remote.name }} - name: 记录成功摘要 if: success()