From dc42f0e226d52d6a0c6574302ee79314ab69a53a Mon Sep 17 00:00:00 2001 From: Suyunjing Date: Fri, 15 Aug 2025 18:36:52 +0800 Subject: [PATCH] [skip ci]fix(ci): update sync workflow (#1061) --- .github/workflows/sync_to_gitee.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sync_to_gitee.yml b/.github/workflows/sync_to_gitee.yml index 3218e6a5..c981b5ec 100644 --- a/.github/workflows/sync_to_gitee.yml +++ b/.github/workflows/sync_to_gitee.yml @@ -14,10 +14,16 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 1 - - name: Mirror to Gitee - uses: pixta-dev/repository-mirroring-action@v1 - with: - target_repo_url: ${{ vars.GITEE_REPO_URL }} - ssh_private_key: ${{ secrets.GITEE_SSH_PRIVATE_KEY }} + - name: Setup SSH + run: | + mkdir -p ~/.ssh + echo "${{ secrets.GITEE_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan gitee.com >> ~/.ssh/known_hosts + + - name: Push to Gitee + run: | + git remote add gitee ${{ vars.GITEE_REPO_URL }} + git push --force gitee main:main