
Settings > Secrets and variables > Actions):GITLAB_URL: The HTTPS URL of your target GitLab repository (e.g., https://gitlab.com/yourusername/yourrepo.git).USERNAME: Your GitLab username.GITLAB_PAT: Your GitLab Personal Access Token. Ensure this token has write_repository scope to push to the repository..github/workflows/sync-to-gitlab.yml):main, master) in the on: push: branches: section of your workflow to avoid unintended syncs.actions/checkout: Always include actions/checkout@vX (preferably the latest version) before this action to ensure your repository's code is available.fetch-depth: 0: Using fetch-depth: 0 with actions/checkout is crucial for ensuring the entire Git history is fetched. This is often necessary for a clean and successful synchronization, especially if you need to sync tags or ensure branch histories are complete.gitlab_url The HTTPS URL of the target GitLab repository (e.g., https://gitlab.com/yourusername/yourrepo.git). Yes N/A username Your GitLab username. Yes N/A gitlab_pat Your GitLab Personal Access Token. Must have permissions to write (write_repository scope) to the target repository. Yes N/A force_push Whether to force push to GitLab. If true, overwrites the destination branch. Use with caution. No falsePosted Aug 10, 2025
Developed a free GitHub Action for syncing code from Github to GitLab.
0
2