name: Sync to GitHub on: push: branches: - '**' delete: branches: - '**' create: tags: - '**' jobs: sync: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 - name: Push to GitHub env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} GITHUB_REPO: ${{ secrets.GH_REPO }} run: | git remote add github https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO}.git || true git remote set-url github https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPO}.git git push github --all --force git push github --tags --force - name: Sync status if: success() run: echo "Successfully synced to GitHub" - name: Sync failed if: failure() run: echo "Failed to sync to GitHub"