Skip to content

A powerful GitHub Action that provides advanced synchronization between GitHub and GitLab repositories, including two-way sync for branches, pull requests/merge requests, and issues.

Notifications You must be signed in to change notification settings

OpenSaucedHub/advanced-git-sync

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

wakatime Releases CLA Assistant

GitHub GitLab Sync Action

A powerful GitHub Action that provides bi-directional synchronization between GitHub and GitLab repositories. Keep your projects in sync across platforms automatically.

✨ Key Features

  • 🔄 Bi-directional sync between GitHub and GitLab
  • 🌳 Branches, PRs/MRs, issues, releases, and tags
  • 💬 Enhanced comment synchronization with proper attribution
  • ⚙️ Highly configurable with logical priority-based defaults
  • 🔒 Secure with token-based authentication
  • 🏷️ Smart labeling of synced content
  • 🧠 Intelligent dependency management - automatically enables required features
  • ⏱️ Chronological sync order - respects dependencies between operations

🚀 Quick Start

1. Create Workflow File

Create .github/workflows/sync.yml:

name: Sync to GitLab
on:
  push:
    branches: [main]
  pull_request:
    types: [opened, closed, reopened]
  issues:
    types: [opened, closed, reopened]
  release:
    types: [published]
  schedule:
    - cron: '0 */6 * * *'
  workflow_dispatch:

jobs:
  sync:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
      issues: write

    steps:
      - name: Checkout Repository
        uses: actions/[email protected]

      - name: Sync with GitLab
        uses: OpenSaucedHub/[email protected]
        with:
          GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
          GH_TOKEN: ${{ secrets.GH_TOKEN }}

2. Set Up Tokens

Add these secrets to your GitHub repository:

  • GITLAB_TOKEN: GitLab personal access token with api scope
  • GH_TOKEN: GitHub personal access token with workflow scope (required for syncing workflow files)

Warning

If your sync includes workflow files (.github/workflows/), you must use a Personal Access Token with the workflow scope instead of the default GITHUB_TOKEN. The default token cannot modify workflow files for security reasons.

3. Basic Configuration (Optional)

Create .github/sync-config.yml for custom settings:

gitlab:
  enabled: true
  projectId: 12345 # Your GitLab project ID

github:
  enabled: true

That's it! The action uses intelligent defaults:

  • Enabled by default: Branches (with history sync), Tags, Releases
  • Disabled by default: Pull Requests, Issues, Comments (can be noisy)
  • 🧠 Smart dependencies: Automatically enables required features (e.g., tags when releases are enabled)

🎉

📖 Documentation

For detailed configuration and advanced usage:

🤝 Need Help?

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

📄 License

MIT License - see the LICENSE file for details.


Built with ❤️ using TypeScript and Bun

Inspired by the need for seamless cross-platform development workflows

About

A powerful GitHub Action that provides advanced synchronization between GitHub and GitLab repositories, including two-way sync for branches, pull requests/merge requests, and issues.

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 2

  •  
  •