mirror of
https://github.com/RetroShare/OpenPGP-SDK.git
synced 2026-09-12 19:50:03 +05:00
The mirror workflow cloned with --mirror and pushed all refs, including GitHub's refs/pull/*, which GitLab rejects as hidden refs, failing the whole push. Clone --bare and push only refs/heads/* and refs/tags/* with --prune, keeping deletion sync while never touching PR refs.
31 lines
776 B
YAML
31 lines
776 B
YAML
name: Mirror to GitLab
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- '**'
|
|
tags:
|
|
- '**'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
mirror:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Install GitLab deploy key
|
|
uses: webfactory/ssh-agent@v0.9.0
|
|
with:
|
|
ssh-private-key: ${{ secrets.RETROSHARE_GITLAB_MIRROR_SSH_KEY }}
|
|
|
|
- name: Trust GitLab host key
|
|
run: |
|
|
ssh-keyscan gitlab.com >> ~/.ssh/known_hosts
|
|
|
|
- name: Mirror repository to GitLab
|
|
run: |
|
|
git clone --bare "https://github.com/${GITHUB_REPOSITORY}.git" repo.git
|
|
cd repo.git
|
|
git remote set-url --push origin git@gitlab.com:RetroShare/OpenPGP-SDK.git
|
|
git push --prune origin 'refs/heads/*:refs/heads/*' 'refs/tags/*:refs/tags/*'
|