Skip to content

ci: mirror the repository to GitLab - #36

Merged
jmrplens merged 1 commit into
mainfrom
ci/gitlab-mirror
Aug 26, 2026
Merged

ci: mirror the repository to GitLab#36
jmrplens merged 1 commit into
mainfrom
ci/gitlab-mirror

Conversation

@jmrplens

@jmrplens jmrplens commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Same mirror workflow as gitlab-mcp-server: force-pushes branches and tags to gitlab.com/jmrp/TFG-TFM_EPS on every push (plus a 6h cron) and syncs GitHub releases to GitLab releases with asset links back to the canonical GitHub assets. Secrets GITLAB_MIRROR_SSH_KEY and GITLAB_API_TOKEN are already configured.

Summary by Sourcery

Mirror the repository and published releases to GitLab through an automated GitHub Actions workflow.

New Features:

  • Add automated mirroring of all repository branches and tags from GitHub to GitLab on pushes, scheduled runs, and manual triggers.
  • Synchronize published GitHub releases and their assets to linked GitLab releases.

Enhancements:

  • Keep GitLab releases and asset links aligned with their canonical GitHub releases, including removal of stale links.

CI:

  • Add a GitHub Actions workflow for force-pushing the repository mirror and syncing releases after successful release workflows.

Review in cubic

Same mirror workflow as gitlab-mcp-server: force-pushes all branches
and tags to the gitlab.com/jmrp mirror on every push (plus a 6h cron),
and syncs GitHub releases to GitLab releases whose asset links point
back at the canonical GitHub assets. Secrets: GITLAB_MIRROR_SSH_KEY
(deploy key with push on the mirror) and GITLAB_API_TOKEN (project
access token, releases sync).
@jmrplens
jmrplens merged commit 205b7d0 into main Aug 26, 2026
@jmrplens
jmrplens deleted the ci/gitlab-mirror branch August 26, 2026 16:57

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @jmrplens, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 1 day and 7 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds a scheduled and event-driven GitHub Actions workflow that force-mirrors branches and tags to GitLab over authenticated SSH, and reconciles published GitHub releases and their assets into GitLab releases via API links.

Sequence diagram for repository mirroring

sequenceDiagram
    participant Trigger as GitHub event
    participant Actions as GitHub Actions
    participant GitHub as GitHub repository
    participant GitLab as GitLab repository

    Trigger->>Actions: Start GitLab Mirror
    Actions->>Actions: Configure GitLab SSH key
    Actions->>GitHub: git fetch --prune --tags
    GitHub-->>Actions: Branch and tag refs
    Actions->>GitLab: git push --force --prune branches and tags
    GitLab-->>Actions: Mirrored refs
Loading

Sequence diagram for GitHub release synchronization

sequenceDiagram
    participant Trigger as Release or scheduled event
    participant Actions as GitHub Actions
    participant GitHub as GitHub Releases API
    participant GitLab as GitLab Releases API

    Trigger->>Actions: Start release synchronization
    Actions->>GitHub: gh api releases
    GitHub-->>Actions: Published releases and assets
    loop Each published release
        Actions->>GitHub: gh release view tag
        GitHub-->>Actions: Release metadata and asset URLs
        Actions->>GitLab: GET release by tag
        alt Release exists
            Actions->>GitLab: PUT release metadata
        else Release is missing
            Actions->>GitLab: POST release metadata
        end
        Actions->>GitLab: POST or PUT release asset links
        Actions->>GitLab: DELETE stale asset links
    end
Loading

File-Level Changes

Change Details Files
Add an automated GitHub-to-GitLab repository mirror workflow.
  • Trigger mirroring on pushes, successful release workflow completions, a six-hour schedule, and manual dispatch.
  • Fetch all GitHub branches and tags into a bare repository, then force-push and prune refs on GitLab.
  • Configure the SSH key, pinned GitLab host key, repository URL, and concurrency controls.
.github/workflows/gitlab-mirror.yml
Synchronize published GitHub releases and assets as linked GitLab releases.
  • Use the GitHub CLI and GitLab API to create or update non-draft releases.
  • Add links to the canonical GitHub release and each GitHub asset, preserving asset names and package link types.
  • Remove stale or duplicate GitLab release asset links and validate the API token.
.github/workflows/gitlab-mirror.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant