From 05c1bb628c14116b4decb47f562441b78d279f17 Mon Sep 17 00:00:00 2001 From: Ni Shentu <87308515+NI0317@users.noreply.github.com> Date: Fri, 26 Jun 2026 16:18:15 +0800 Subject: [PATCH] Add GitHub Actions workflow to mirror to GitLab --- .github/workflows/mirror-to-gitlab.yml | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/mirror-to-gitlab.yml diff --git a/.github/workflows/mirror-to-gitlab.yml b/.github/workflows/mirror-to-gitlab.yml new file mode 100644 index 0000000000..671915ba49 --- /dev/null +++ b/.github/workflows/mirror-to-gitlab.yml @@ -0,0 +1,33 @@ +name: Mirror to GitLab + +on: + push: + branches: ['**'] + tags: ['**'] + delete: + workflow_dispatch: + +concurrency: + group: mirror-to-gitlab + cancel-in-progress: false + +jobs: + mirror: + runs-on: ubuntu-latest + steps: + - name: Checkout full history + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup SSH + run: | + mkdir -p ~/.ssh + echo "${{ secrets.GITLAB_SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + ssh-keyscan -t rsa,ecdsa,ed25519 gitlab.com >> ~/.ssh/known_hosts + + - name: Push to GitLab + run: | + git remote add gitlab "${{ secrets.GITLAB_REPO_URL }}" + git push --mirror gitlab