1
0
Fork 0

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.
This commit is contained in:
pooneyy 2026-03-07 03:05:18 +08:00
parent a49f498c57
commit 8b1db7bc1e
No known key found for this signature in database
2 changed files with 8 additions and 4 deletions

View File

@ -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()

View File

@ -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()