What it does
gitlab-sync is a GitHub Action that automatically mirrors any GitHub repository to GitLab on every push. Drop it into a workflow file, configure three secrets, and your repos stay in sync — no server, no cron job, no cost.
It's used across 162 repositories by developers who want GitLab as a backup, need to satisfy compliance requirements, or run CI/CD pipelines on both platforms.
Setup
Three secrets and a workflow file:
fetch-depth: 0 matters — without it, GitHub's shallow clone only mirrors the latest commit instead of the full history.
Why it exists
Most mirroring solutions require a server, a cron job, or a paid GitLab tier. gitlab-sync runs entirely inside GitHub Actions — fires on push, does the sync, exits. The force_push option handles cases where histories have diverged and you need to overwrite the destination.