DevFlow logoDevFlow
GitHub ActionsGitLab CI (.gitlab-ci.yml)Automated Breaking Change Check

Migrate GitHub Actions Workflows to GitLab CI

Translate GitHub Actions YAML workflows into robust .gitlab-ci.yml pipelines with stages, container images, caching, and artifacts.

From: GitHub Actions
To: GitLab CI (.gitlab-ci.yml)
Source (GitHub Actions)
348 chars
Migrated Target (GitLab CI (.gitlab-ci.yml))
1ms233 chars
stages:
  - test
  - deploy

default:
  image: oven/bun:latest

test_job:
  stage: test
  script:
    - npm ci
    - npm test
    - npm run build
  cache:
    key: ${CI_COMMIT_REF_SLUG}
    paths:
      - node_modules/
      - .bun/

Detected Breaking Changes & Semantic Shifts (2)

Runner & Image Specification
warning

GitLab CI requires explicit Docker images for jobs, whereas GitHub Actions provides Ubuntu VM runners.

Resolution: Specify `image: node:20` or your desired container at the top or per-job level.
Marketplace Actions Replacement
breaking

GitHub Action marketplace steps (e.g. actions/checkout, actions/setup-node) must be replaced with shell scripts.

Resolution: Use native script commands or GitLab CI include components.

How to Migrate from GitHub Actions to GitLab CI (.gitlab-ci.yml)

  1. 1

    Paste your GitHub Actions workflow YAML file.

  2. 2

    The migrator extracts step commands into GitLab CI `script` arrays.

  3. 3

    Map workflow triggers (`push`, `pull_request`) into GitLab CI `rules` and `stages`.

  4. 4

    Copy the generated config into `.gitlab-ci.yml` in your GitLab repository.

Verify .gitlab-ci.yml via GitLab Lint API

scripts/lint-ci.sh
curl --header "PRIVATE-TOKEN: $GITLAB_TOKEN" \
  --header "Content-Type: application/json" \
  --data '{"content": "'"$(cat .gitlab-ci.yml | jq -s -R .)"'"}' \
  "https://gitlab.com/api/v4/ci/lint"

Run Migration via Terminal CLI

Perform identical migration routines across entire directories or repositories in your local terminal:

devflow migrate gha-to-gitlab -i .github/workflows/ci.yml -o .gitlab-ci.yml

Frequently Asked Questions

How are GitHub Secrets referenced in GitLab CI?
GitHub `${{ secrets.MY_SECRET }}` translates directly to GitLab CI environment variables `$MY_SECRET` configured under Settings > CI/CD > Variables.
Was this guide / tool helpful to you?