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:
parent
a49f498c57
commit
8b1db7bc1e
|
|
@ -76,7 +76,8 @@ jobs:
|
||||||
- name: 强制推送所有分支和所有标签到 ${{ matrix.remote.name }}
|
- name: 强制推送所有分支和所有标签到 ${{ matrix.remote.name }}
|
||||||
run: |
|
run: |
|
||||||
echo "将仓库同步到 ${{ matrix.remote.name }}..."
|
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: 记录成功摘要
|
- name: 记录成功摘要
|
||||||
if: success()
|
if: success()
|
||||||
|
|
@ -133,7 +134,8 @@ jobs:
|
||||||
- name: 强制推送所有分支和所有标签到 ${{ matrix.remote.name }}
|
- name: 强制推送所有分支和所有标签到 ${{ matrix.remote.name }}
|
||||||
run: |
|
run: |
|
||||||
echo "将仓库同步到 ${{ matrix.remote.name }}..."
|
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: 记录成功摘要
|
- name: 记录成功摘要
|
||||||
if: success()
|
if: success()
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,8 @@ jobs:
|
||||||
- name: 强制推送所有分支和所有标签到 ${{ matrix.remote.name }}
|
- name: 强制推送所有分支和所有标签到 ${{ matrix.remote.name }}
|
||||||
run: |
|
run: |
|
||||||
echo "将仓库同步到 ${{ matrix.remote.name }}..."
|
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: 记录成功摘要
|
- name: 记录成功摘要
|
||||||
if: success()
|
if: success()
|
||||||
|
|
@ -122,7 +123,8 @@ jobs:
|
||||||
- name: 强制推送所有分支和所有标签到 ${{ matrix.remote.name }}
|
- name: 强制推送所有分支和所有标签到 ${{ matrix.remote.name }}
|
||||||
run: |
|
run: |
|
||||||
echo "将仓库同步到 ${{ matrix.remote.name }}..."
|
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: 记录成功摘要
|
- name: 记录成功摘要
|
||||||
if: success()
|
if: success()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue