<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Devadathks on Medium]]></title>
        <description><![CDATA[Stories by Devadathks on Medium]]></description>
        <link>https://medium.com/@devadathks004?source=rss-81d3e92929c2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Ek496JmjqdkgJwUu</url>
            <title>Stories by Devadathks on Medium</title>
            <link>https://medium.com/@devadathks004?source=rss-81d3e92929c2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 11:30:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@devadathks004/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Your Developers Belong on GitHub. Your CI/CD Belongs on GitLab. Here’s the Bridge.]]></title>
            <link>https://medium.com/@devadathks004/your-developers-belong-on-github-your-ci-cd-belongs-on-gitlab-heres-the-bridge-f409bbc632b1?source=rss-81d3e92929c2------2</link>
            <guid isPermaLink="false">https://medium.com/p/f409bbc632b1</guid>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Devadathks]]></dc:creator>
            <pubDate>Sat, 14 Mar 2026 22:20:09 GMT</pubDate>
            <atom:updated>2026-03-14T22:20:09.592Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*S64UBD9m6EgkB9V4T9V2NA.png" /></figure><p>There’s a question that comes up in almost every growing engineering org: where do you run your CI/CD?</p><p>GitHub Actions is convenient. It’s right there where your code lives. But once you start scaling ,more pipelines, more runners, more parallel jobs — the cost conversation gets uncomfortable fast. GitLab CI on the other hand is genuinely powerful, highly configurable, and significantly cheaper to run at scale, especially if you’re self-hosting.</p><p>The problem is you can’t just say “okay everyone move to GitLab” and expect developers to be happy about it. They like GitHub. They’re used to GitHub. Pull requests, Copilot, the familiar interface ,it’s where they live. Forcing them into a second platform just to trigger a pipeline is friction nobody wants.</p><p>So I built something that gives you both. Developers stay on GitHub. CI/CD runs entirely on GitLab. And a new repository fully mirrored, with the right GitLab group hierarchy, ready for pipelines can be provisioned by filing a single GitHub Issue.</p><p>This post is a walkthrough of how it works, why I built it this way, and how you can set it up yourself.</p><h3>The Problem I Was Actually Solving</h3><p>Before I get into the how, let me be specific about the pain points.</p><p>Every new repository needed someone to manually create it on GitHub, then go to GitLab, navigate the group hierarchy (or create it if it didn’t exist), create the project, configure the pull mirror, paste in credentials, and verify it was working. That’s five to ten minutes of work per repo it requires GitLab access for everyone involved and it’s the kind of thing that gets done inconsistently because it’s boring and repetitive.</p><p>The second problem was naming. Without a convention enforced at creation time, repos drift. You end up with payments-service, paymentsService, svc-payments, and payments-backend-v2 all meaning roughly the same thing. Grepping across your GitHub org becomes a nightmare.</p><p>The third problem is cost. Giving every developer a GitLab seat when they’re only ever committing code on GitHub is pure waste.</p><p>This system solves all three.</p><h3>The Architecture</h3><p>Here’s the full picture :</p><pre>Developer<br>  │<br>  ▼<br>GitHub Issue (filled-in form)<br>  │<br>  ▼<br>repository-provisioning.yml (GitHub Actions)<br>  ├── Validates all form fields<br>  ├── Creates the GitHub repo with enforced naming<br>  ├── Stamps topics onto the repo (product, aspect, name, tenant)<br>  └── Optionally pushes a thin caller workflow into the new repo<br>           │<br>           ▼ (triggered manually from the new repo&#39;s Actions tab)<br>  provision-gitlab-mirror.yml (reusable, lives in central-workflows)<br>  ├── Reads topics back from GitHub to reconstruct the hierarchy<br>  ├── Creates GitLab group hierarchy if it doesn&#39;t exist<br>  ├── Creates the GitLab project if it doesn&#39;t exist<br>  └── Configures pull mirroring from GitHub → GitLab</pre><p>The key insight is that <strong>GitHub topics act as the single source of truth</strong> for everything that happens on the GitLab side. When the provisioning workflow creates a repo, it stamps structured topics onto it — product-payments, aspect-backend, repo-transaction-service. The GitLab mirror workflow reads those topics back later and uses them to build the exact group path where the project should live.</p><p>This means the two workflows are completely decoupled. The mirror can be set up at any point in the future, by anyone, and it’ll always land in the right place.</p><h3>The Repository Structure</h3><p>You need two repositories for this to work:</p><p><strong>platform-repo-provisioner</strong> — This is the public-facing repo. The issue template lives here. Developers file issues here. The provisioning workflow runs here.</p><p><strong>central-workflows</strong> — This holds the reusable GitLab mirror workflow. It&#39;s called by every provisioned repo that needs mirroring. Keeping it centralised means you fix it once and all repos benefit.</p><h3>Part 1: The Issue Template</h3><p>The developer experience starts with an issue form. When a developer goes to open a new issue in platform-repo-provisioner, they see a structured form instead of a blank text box.</p><pre># .github/ISSUE_TEMPLATE/repo-creation-request.yml</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rRpmVlw-0HkCNP6yJBRmRw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wx5-Dh8Lsaw4kA45cIG4Sw.png" /><figcaption>THE REPO THAT’S CREATED:</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F8JJYLa2Wz_11I4Cjk_JGQ.png" /></figure><p>The form captures: Product Line, Aspect/Domain, Repository Name, an optional Tenant (for multi-tenant setups), a Description, Visibility, and two optional checkboxes — one to initialise with a README, and one to add the GitLab mirror workflow automatically.</p><p>The reason I used a GitHub Issue form instead of, say, a CLI tool or a web app, is zero infrastructure. There’s no server to maintain, no database, no auth layer. The GitHub Issues UI is the frontend. GitHub Actions is the backend. Developers already know how to file issues.</p><h3>Part 2: The Provisioning Workflow</h3><p>When an issue is opened or edited with the right label and title prefix, the workflow fires.</p><h3>Triggering safely</h3><pre>jobs:<br>  process:<br>    if: &gt;<br>      github.event.issue.state == &#39;open&#39; &amp;&amp;<br>      contains(github.event.issue.labels.*.name, &#39;repo-creation-request&#39;) &amp;&amp;<br>      startsWith(github.event.issue.title, &#39;[REPO-CREATION-REQUEST]&#39;)</pre><p>All three conditions must be true. This prevents the workflow from running on every issue in the repo only ones that are explicitly tagged and titled correctly.</p><h3>Using a GitHub App instead of a PAT</h3><p>The workflow uses a GitHub App token to create repositories. This is an important distinction. A personal access token tied to someone’s account is fragile it breaks when that person leaves the org, it has more permissions than necessary, and rotation is manual. A GitHub App is purpose-built, has scoped permissions, and generates short-lived tokens automatically.</p><pre>- uses: tibdex/github-app-token@v2<br>  id: app-token<br>  with:<br>    app_id: ${{ secrets.APP_ID }}<br>    private_key: ${{ secrets.APP_PRIVATE_KEY }}</pre><h3>Parsing the issue body</h3><p>GitHub issue forms render as markdown in the issue body. The workflow extracts field values using a simple regex against the rendered section headers:</p><pre>function extract(label) {<br>  const regex = new RegExp(`### ${label}\\s+([\\s\\S]*?)(?=\\n###|$)`);<br>  const match = body.match(regex);<br>  return match ? match[1].trim() : null;<br>}</pre><pre>const product = extract(&quot;Product Line&quot;);<br>const aspect  = extract(&quot;Aspect / Domain&quot;);<br>const name    = extract(&quot;Repository Name&quot;);</pre><h3>Validation</h3><p>Before anything is created, the workflow validates:</p><pre>// Enforce kebab-case — this is what keeps naming consistent<br>if (!/^[a-z0-9-]+$/.test(name)) {<br>  core.setOutput(&quot;status&quot;, &quot;PARSE_ERROR&quot;);<br>  core.setOutput(&quot;message&quot;, &quot;Repository name must be kebab-case.&quot;);<br>  return;<br>}</pre><pre>// GitLab mirror needs somewhere to commit the workflow file<br>if (addGitlabMirror &amp;&amp; !autoInit) {<br>  core.setOutput(&quot;status&quot;, &quot;PARSE_ERROR&quot;);<br>  core.setOutput(&quot;message&quot;, &quot;&#39;Add GitLab Mirror Workflow&#39; requires &#39;Initialize repository with README&#39; to also be checked.&quot;);<br>  return;<br>}</pre><p>The naming convention is enforced at creation time, not as a guideline. You can’t submit a PascalCase or snake_case name — it’ll fail validation and comment back on the issue explaining why.</p><h3>Building the repo name</h3><p>The final name is assembled from the parsed fields:</p><pre>// Without tenant: payments-backend-transaction-service<br>// With tenant:    payments-backend-transaction-service-acme<br>const finalName = tenant<br>  ? `${product}-${aspect}-${name}-${tenant}`<br>  : `${product}-${aspect}-${name}`;</pre><p>Every repository in your GitHub org will follow this pattern. It’s searchable, it’s sortable, and you can instantly tell what a repo does and who owns it just from its name.</p><h3>Duplicate detection</h3><p>Before creating anything, the workflow checks whether the repo already exists:</p><pre>try {<br>  const existing = await github.rest.repos.get({<br>    owner: context.repo.owner,<br>    repo: finalName<br>  });<br>  // If we got here, it exists — return early<br>  core.setOutput(&quot;status&quot;, &quot;DUPLICATE&quot;);<br>  return;<br>} catch (err) {<br>  if (err.status === 404) {<br>    // Good — doesn&#39;t exist yet<br>  }<br>}</pre><p>If it already exists, the issue gets a comment with the URL to the existing repo and closes. No duplicate repos.</p><h3>Creating the repository</h3><pre>// Note: for personal accounts, use createForAuthenticatedUser instead of createInOrg<br>const repo = await github.rest.repos.createForAuthenticatedUser({<br>  name: finalName,<br>  description,<br>  visibility,<br>  auto_init: autoInit<br>});</pre><h3>Stamping topics</h3><p>This is the clever bit. After creation, structured topics are applied to the repo:</p><pre>function sanitizeTopic(value) {<br>  return value<br>    .toLowerCase()<br>    .replace(/[^a-z0-9-]/g, &quot;-&quot;)<br>    .replace(/-+/g, &quot;-&quot;)<br>    .replace(/^-|-$/g, &quot;&quot;);<br>}</pre><pre>const topics = [<br>  `product-${sanitizeTopic(product)}`,<br>  `aspect-${sanitizeTopic(aspect)}`,<br>  `repo-${sanitizeTopic(name)}`<br>];</pre><pre>if (tenant) topics.push(`tenant-${sanitizeTopic(tenant)}`);</pre><pre>await github.rest.repos.replaceAllTopics({<br>  owner: context.repo.owner,<br>  repo: finalName,<br>  names: topics<br>});</pre><p>These topics serve two purposes: they make repos browsable by category on GitHub, and they’re how the GitLab mirror workflow knows where to put the project without needing any additional configuration passed to it.</p><h3>Optionally pushing the mirror workflow</h3><p>If the developer checked “Add GitLab Mirror Workflow”, a thin caller workflow file is committed directly into the new repo:</p><pre>const lines = [<br>  &quot;name: Provision GitLab Mirror&quot;,<br>  &quot;&quot;,<br>  &quot;on:&quot;,<br>  &quot;  workflow_dispatch:&quot;,<br>  &quot;&quot;,<br>  &quot;jobs:&quot;,<br>  &quot;  mirror:&quot;,<br>  &quot;    uses: YOUR_USERNAME/central-workflows/.github/workflows/provision-gitlab-mirror.yml@main&quot;,<br>  &quot;    secrets: inherit&quot;,<br>  &quot;&quot;<br>];</pre><pre>await github.rest.repos.createOrUpdateFileContents({<br>  owner: context.repo.owner,<br>  repo: finalName,<br>  path: &quot;.github/workflows/gitlab-mirror.yml&quot;,<br>  message: &quot;chore: add GitLab mirror caller workflow&quot;,<br>  content: Buffer.from(lines.join(&quot;\n&quot;)).toString(&quot;base64&quot;)<br>});</pre><p>The new repo gets a workflow file that calls the central reusable workflow. The developer just goes to the Actions tab of their new repo, runs “Provision GitLab Mirror”, and the GitLab side is set up automatically.</p><h3>Part 3: The GitLab Mirror Workflow</h3><p>This is the reusable workflow that lives in central-workflows. It can be called from any repo — either automatically via workflow_call or manually via workflow_dispatch.</p><h3>Reading topics to reconstruct the hierarchy</h3><p>The first thing it does is read the GitHub repo’s topics:</p><pre>const { data: topicData } = await github.rest.repos.getAllTopics({<br>  owner: context.repo.owner,<br>  repo: context.repo.repo<br>});</pre><pre>function extractTopic(prefix) {<br>  const match = topics.find(t =&gt; t.startsWith(`${prefix}-`));<br>  return match ? match.slice(prefix.length + 1) : null;<br>}</pre><pre>const product = extractTopic(&quot;product&quot;); // &quot;payments&quot;<br>const aspect  = extractTopic(&quot;aspect&quot;);  // &quot;backend&quot;<br>const name    = extractTopic(&quot;repo&quot;);    // &quot;transaction-service&quot;<br>const tenant  = extractTopic(&quot;tenant&quot;);  // &quot;acme&quot; or null</pre><p>No configuration needed. The workflow reads what the provisioning workflow stamped and uses it to build everything.</p><h3>Building the GitLab group hierarchy</h3><p>Groups are created idempotently — the function checks if a group already exists before trying to create it:</p><pre>async function findOrCreateGroup(parentId, groupPath, groupName) {<br>  // Search for existing subgroup<br>  const res = await fetch(<br>    `${GITLAB_HOST}/api/v4/groups/${parentId}/subgroups?search=${encodeURIComponent(groupPath)}`,<br>    { headers: { &quot;PRIVATE-TOKEN&quot;: GITLAB_API_TOKEN } }<br>  );<br>  const subgroups = await res.json();<br>  const existing  = subgroups.find(g =&gt; g.path === groupPath);</pre><pre>  if (existing) return existing;</pre><pre>  // Create it if not found<br>  return await glFetch(&quot;POST&quot;, &quot;/groups&quot;, {<br>    name:       groupName,<br>    path:       groupPath,<br>    parent_id:  parseInt(parentId),<br>    visibility: &quot;private&quot;<br>  });<br>}</pre><p>The hierarchy it builds depends on whether a tenant was specified:</p><pre>Without tenant:              With tenant:<br>top-level-group              top-level-group<br>└── internal                 └── acme<br>    └── payments                 └── payments<br>        └── backend                  └── backend<br>            └── transaction-service      └── transaction-service</pre><p>You get a clean, browsable namespace in GitLab that mirrors the structure implied by your GitHub repo names — and it’s created automatically, you never have to click around in the GitLab UI.</p><h3>Configuring pull mirroring</h3><p>Once the project exists (or is created), pull mirroring is configured:</p><pre>const authCloneUrl = `https://${MIRROR_USERNAME}:${MIRROR_TOKEN}@github.com/${repoFullName}.git`;</pre><pre>await glFetch(&quot;PUT&quot;, `/projects/${projectId}/mirror/pull`, {<br>  enabled: true,<br>  url:     authCloneUrl<br>});</pre><p>GitLab will now pull from GitHub on a schedule. Any push to GitHub eventually shows up in GitLab, where your pipelines pick it up and run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pw8S-DMaUWlvXcy3e80-CA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xcu0NU_NuGbDRel7gVCmsg.png" /></figure><blockquote><strong><em>Important:</em></strong><em> Pull mirroring requires GitLab Premium or GitLab Ultimate. If you’re on the free tier or self-hosting CE, you’ll need to adapt this to push mirroring instead push from GitHub Actions on every commit rather than having GitLab pull.</em></blockquote><h3>Part 4: For Org Users -Workflow Templates (Optional Enhancement)</h3><p>If you’re implementing this in a GitHub organisation rather than a personal account, there’s a nice additional touch you can add: a workflow template.</p><p>In an org, creating a .github repository with files in workflow-templates/ makes those templates available in every repo&#39;s &quot;New workflow&quot; picker. This means a developer who wants to add mirroring to an <em>existing</em> repo doesn&#39;t need to file a provisioning issue they just go to Actions, click &quot;New workflow&quot;, and find the mirror template under your org&#39;s section.</p><p>You need two files in the org’s .github repo:</p><pre># workflow-templates/gitlab-mirror.yml<br>name: Provision GitLab Mirror</pre><pre>on:<br>  workflow_dispatch:</pre><pre>jobs:<br>  mirror:<br>    uses: YOUR_ORG/central-workflows/.github/workflows/provision-gitlab-mirror.yml@main<br>    secrets: inherit</pre><pre>// workflow-templates/gitlab-mirror.properties.json<br>{<br>  &quot;name&quot;: &quot;Provision GitLab Mirror&quot;,<br>  &quot;description&quot;: &quot;Sets up a GitLab pull mirror for this repository.&quot;,<br>  &quot;iconName&quot;: &quot;octicon-mirror&quot;,<br>  &quot;categories&quot;: [&quot;platform&quot;]<br>}</pre><p>This doesn’t work on personal accounts it’s an org-only feature. But if you’re deploying this for a team, it’s worth the two extra files.</p><h3>Setting It Up Yourself</h3><p>Full setup instructions are in the README of the repo (link below), but here’s the overview:</p><p><strong>What you need:</strong></p><ul><li>Two GitHub repos: platform-repo-provisioner and central-workflows</li><li>A GitHub App with Administration, Contents, and Issues permissions, installed on your account/org</li><li>A GitLab account on Premium or Ultimate (for pull mirroring)</li><li>A top-level GitLab group to house all the mirrored projects</li></ul><p><strong>Secrets in </strong><strong>platform-repo-provisioner:</strong></p><p>APP_IDYour GitHub App&#39;s numeric IDAPP_PRIVATE_KEYThe .pem private key for the app</p><p>CREATE A GITHUB APP TO GET THESE SECRETS , add repository permissions while creating: Administration , Contents, Issues , Workflows,<br>Metadata- read and write access</p><p><strong>Secrets in </strong><strong>central-workflows:</strong></p><p>GITLAB_HOSTe.g. <a href="https://gitlab.com/">https://gitlab.com</a></p><p>GITLAB_API_TOKENGitLab token with api + write_repository scopes</p><p>GITLAB_TOP_LEVEL_GROUP_IDNumeric ID of your top-level GitLab group</p><p>GITLAB_ORG_SUBGROUPFallback group name when no tenant is specified</p><p>MIRROR_USERNAMEGitHub username for the authenticated clone URL</p><p>MIRROR_TOKENGitHub PAT (classic, repo scope)</p><p>Don’t forget to create the repo-creation-request label in platform-repo-provisioner the workflow won&#39;t trigger without it.</p><h3>What This Actually Gives You</h3><p>After spending time with this setup, here’s what the day-to-day looks like:</p><p>A developer needs a new service. They go to platform-repo-provisioner, open a new issue, fill in the form, and submit. Thirty seconds later they get a comment back with a link to their new GitHub repo. The name follows the convention, topics are applied, and if they checked the mirror box, a workflow is already waiting in their Actions tab.</p><p>They do their work on GitHub. PRs, code review, merging — all the normal stuff. When they’re ready to set up CI/CD, they run the mirror workflow once. GitLab creates the project in exactly the right place in the group hierarchy, and pull mirroring starts. Their pipelines in GitLab pick up commits automatically from that point on.</p><p>Platform engineers manage the GitLab side. Developers never need a GitLab account. CI/CD costs are contained to the repos that actually need pipelines, not spread across every developer seat.</p><h3>What’s Missing / What I’d Build Next</h3><p>A few things this doesn’t handle yet that would be worth adding:</p><p><strong>Repository deletion</strong> -there’s no issue-driven off boarding flow. Right now if you want to archive or delete a repo you do it manually.</p><p><strong>CI/CD checks on merge request events of github</strong>-without a a ci/cd check on github side merging branches might cause trouble when pulled into Gitlab.</p><p><strong>Branch protection rules</strong> -the provisioning workflow could apply default branch protections (require PR reviews, status checks, etc.) at creation time instead of leaving it to each team.</p><p><strong>Push mirroring fallback</strong> -for teams on GitLab CE, a variant of the mirror workflow that uses GitHub Actions to push on every commit rather than having GitLab pull would make this accessible to more setups.</p><p><strong>Terraform integration</strong> -if your infrastructure repos drive cloud resource provisioning, wiring the repo creation flow into a Terraform workspace setup would be a natural extension.</p><h3>The Code</h3><p>Everything is on GitHub. The provisioning repo with the issue template and workflows, and the central-workflows repo with the reusable mirror workflow-links below</p><p><a href="https://github.com/gitlab-poc-org/central-workflows">central-workflows</a><br><a href="https://github.com/gitlab-poc-org/platform-repo-provisioner">platform-repo-provisioner</a><br>gitlab-poc-org = <a href="https://github.com/gitlab-poc-org">https://github.com/gitlab-poc-org</a></p><p>If you end up using this or adapting it, I’d love to hear how and if you spot something that could be done better, open an issue or a PR</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f409bbc632b1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>