fix(ci): use HTTPS token for GitHub mirror
Some checks failed
CI/CD / Test (push) Successful in 29s
CI/CD / Lint (push) Successful in 39s
CI/CD / Generate SBOM (push) Successful in 16s
CI/CD / Build (darwin-amd64) (push) Successful in 21s
CI/CD / Build (linux-amd64) (push) Successful in 21s
CI/CD / Build (darwin-arm64) (push) Successful in 22s
CI/CD / Build (linux-arm64) (push) Successful in 21s
CI/CD / Build & Push Docker Image (push) Successful in 21s
CI/CD / Mirror to GitHub (push) Failing after 42s
CI/CD / Release (push) Has been skipped
Some checks failed
CI/CD / Test (push) Successful in 29s
CI/CD / Lint (push) Successful in 39s
CI/CD / Generate SBOM (push) Successful in 16s
CI/CD / Build (darwin-amd64) (push) Successful in 21s
CI/CD / Build (linux-amd64) (push) Successful in 21s
CI/CD / Build (darwin-arm64) (push) Successful in 22s
CI/CD / Build (linux-arm64) (push) Successful in 21s
CI/CD / Build & Push Docker Image (push) Successful in 21s
CI/CD / Mirror to GitHub (push) Failing after 42s
CI/CD / Release (push) Has been skipped
This commit is contained in:
@@ -200,16 +200,13 @@ jobs:
|
|||||||
needs: [test, lint]
|
needs: [test, lint]
|
||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.MIRROR_ENABLED != 'false'
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.MIRROR_ENABLED != 'false'
|
||||||
steps:
|
steps:
|
||||||
- name: Setup SSH key
|
- name: Checkout repository
|
||||||
run: |
|
uses: actions/checkout@v4
|
||||||
mkdir -p ~/.ssh
|
with:
|
||||||
echo "${{ secrets.GITHUB_MIRROR_SSH_KEY }}" > ~/.ssh/id_ed25519
|
fetch-depth: 0
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
|
||||||
ssh-keyscan github.com >> ~/.ssh/known_hosts
|
|
||||||
|
|
||||||
- name: Clone and mirror
|
- name: Push to GitHub
|
||||||
run: |
|
run: |
|
||||||
git clone --mirror ${{ env.GITEA_URL }}/${GITHUB_REPOSITORY}.git repo.git
|
git remote add github https://x-access-token:${{ secrets.GITHUB_MIRROR_TOKEN }}@github.com/PlusOne/hmac-file-server.git
|
||||||
cd repo.git
|
git push --force --all github
|
||||||
git remote add github git@github.com:PlusOne/hmac-file-server.git
|
git push --force --tags github
|
||||||
git push --mirror github || (git push --force --all github && git push --force --tags github)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user