Skip to content

Commit 71ada3b

Browse files
authored
fix(ci-sync): fix workflow for syncing Repository (#1062)
1 parent dc42f0e commit 71ada3b

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/sync_to_gitee.yml renamed to .github/workflows/sync_repo.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v4
1616
with:
17-
fetch-depth: 1
17+
fetch-depth: 0
1818

1919
- name: Setup SSH
2020
run: |
@@ -23,7 +23,16 @@ jobs:
2323
chmod 600 ~/.ssh/id_rsa
2424
ssh-keyscan gitee.com >> ~/.ssh/known_hosts
2525
26-
- name: Push to Gitee
26+
- name: Create single commit and push
2727
run: |
28+
git config user.name "GitHub Actions"
29+
git config user.email "actions@github.com"
30+
31+
# Create a new branch
32+
git checkout --orphan new-main
33+
git add .
34+
git commit -m "Sync from GitHub: $(date)"
35+
36+
# Add Gitee remote and force push
2837
git remote add gitee ${{ vars.GITEE_REPO_URL }}
29-
git push --force gitee main:main
38+
git push --force gitee new-main:main

0 commit comments

Comments
 (0)