diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index d3e1cfc..bf010b0 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -31,11 +31,13 @@ jobs: - name: Copy Gitea repository content excluding workflows run: | rsync -av --exclude='.github/workflows' gitea_repo/ . - + - name: Commit and push changes to GitHub env: GH_TOKEN: ${{ secrets.GH_TOKEN }} run: | + git rm -r --cached gitea_repo + git pull --rebase git add -A git commit -m "Sync from Gitea repository" || echo "No changes to commit" git push https://${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}.git HEAD:${{ github.ref }}