From 88815da23649a9373ac01a5e9d0ca8dfd2a9c627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8A=89=E4=BA=9E=E5=9D=A4?= Date: Wed, 12 Jun 2024 09:23:03 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.github/workflows/sync.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sync.yml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index bf8b16b..400dc4b 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -19,28 +19,18 @@ jobs: run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - - name: Clone Gitea repository env: GITEA_URL: ${{ secrets.GITEA_URL }} GITEA_USERNAME: ${{ secrets.GITEA_USERNAME }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} run: | - git clone https://${GITEA_USERNAME}:${GITEA_TOKEN}@${GITEA_URL} gitea_repo - - - name: Sync changes to GitHub excluding .github directory + git clone --mirror https://${GITEA_USERNAME}:${GITEA_TOKEN}@${GITEA_URL} gitea_repo + - name: Sync changes to GitHub env: GITHUB_ACTOR: ${{ github.actor }} GH_TOKEN: ${{ secrets.GH_TOKEN }} run: | - # Checkout the GitHub repository - git clone https://${GITHUB_ACTOR}:${GH_TOKEN}@github.com/${{ github.repository }} github_repo - - # Use rsync to sync the code from Gitea repository to GitHub repository, excluding .github directory - rsync -av --exclude='.github' gitea_repo/ github_repo/ - - # Commit and push changes to GitHub repository - cd github_repo - git add . - git commit -m "Sync from Gitea excluding .github directory" - git push origin master + cd gitea_repo + git remote set-url --push origin https://${GITHUB_ACTOR}:${GH_TOKEN}@github.com/YaKun9/SageTools.git + git push --mirror \ No newline at end of file