This guide outlines the steps to integrate the mirror-to-GitLab workflow into a new repository.
Before proceeding, ensure you have the following:
- A GitHub repository containing the code you want to mirror to GitLab.
- Access to both GitHub and GitLab accounts.
- Navigate to GitLab > User settings > Access Tokens.
- Generate a PAT with at least the
write_repository
scope.
- Go to your GitHub repository's Settings.
- Navigate to Secrets and Variables under Actions.
- Add the generated PAT as a repository secret.
- Name the secret
GITLAB_MIRROR_TOKEN
.
- Name the secret
- Control git config name and email in your workflow YML file (lines 28-29).
- Update with appropriate name and email.
- Create a host repository in GitLab, ideally with the same name as your GitHub repository.
- Go to your GitHub repository's Settings.
- Navigate to Secrets and Variables under Actions.
- Add the host repository URL as a repository secret.
- Name the secret
GITLAB_REPO_URL
(example value -> "https://gitlab.com/<USERNAME>/<PROJECT>.git").
- Name the secret
- Ensure proper permissions and access controls are set up on both GitHub and GitLab repositories.
- For any assistance or issues, refer to the documentation of GitHub Actions and GitLab.