diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 447e4fd..2ca1d28 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -200,16 +200,13 @@ jobs: needs: [test, lint] if: github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.MIRROR_ENABLED != 'false' steps: - - name: Setup SSH key - run: | - mkdir -p ~/.ssh - echo "${{ secrets.GITHUB_MIRROR_SSH_KEY }}" > ~/.ssh/id_ed25519 - chmod 600 ~/.ssh/id_ed25519 - ssh-keyscan github.com >> ~/.ssh/known_hosts + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Clone and mirror + - name: Push to GitHub run: | - git clone --mirror ${{ env.GITEA_URL }}/${GITHUB_REPOSITORY}.git repo.git - cd repo.git - git remote add github git@github.com:PlusOne/hmac-file-server.git - git push --mirror github || (git push --force --all github && git push --force --tags github) + git remote add github https://x-access-token:${{ secrets.GITHUB_MIRROR_TOKEN }}@github.com/PlusOne/hmac-file-server.git + git push --force --all github + git push --force --tags github