Loading converter...
How to Convert GitLab CI to GitHub Actions - Step by Step Guide
Bring Your .gitlab-ci.yml
Open your GitLab repository and copy the .gitlab-ci.yml from its root, or upload the file directly.
.test_template, extends:, YAML anchors and !reference tags are merged into the jobs that use them.include: are not part of what you paste. Paste their jobs in as well, or convert them separately.Example: a small .gitlab-ci.yml
stages:
- build
- test
image: node:20
build:
stage: build
script:
- npm ci
- npm run build
artifacts:
paths:
- dist/
test:
stage: test
script:
- npm ci
- npm testWhat Gets Converted
The output follows the GitHub Actions workflow syntax. Here is how the main GitLab pieces map across:
needs: lists are kept as they are.if: on the job, and merge request rules add a pull_request trigger.if: always().Example: the Step 1 file as a workflow
name: CI
'on':
push: {}
jobs:
build:
runs-on: ubuntu-latest
container:
image: node:20
steps:
- uses: actions/checkout@v4
- name: build
run: |-
npm ci
npm run build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: dist/
test:
runs-on: ubuntu-latest
needs:
- build
container:
image: node:20
steps:
- uses: actions/checkout@v4
- name: Download artifacts of build
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: dist
- name: test
run: |-
npm ci
npm testReview the Notes
Whatever needs a decision from you is written as comments at the top of the workflow. The ones that come up most:
Add the Workflow to Your Repository
.github/workflows/ at the root of your repository (create the folder if needed).act can run it locally first if you prefer.Frequently Asked Questions
How do GitLab stages turn into GitHub jobs?
Each GitLab job becomes a GitHub job with the same name, cleaned up where GitHub needs a plain id (test:unit becomes test_unit and keeps its original name for display). GitHub has no stages, so every job needs the jobs of the stage before it, which gives the same order. A job with its own needs: list keeps that list instead, and needs: [] starts right away. Templates whose names start with a dot, extends: and YAML anchors are merged into each job first.
What happens to rules, only and except?
They become an if: on the job. $CI_PIPELINE_SOURCE == "merge_request_event" turns into a pull_request check and adds a pull_request trigger, $CI_COMMIT_BRANCH and $CI_COMMIT_TAG comparisons become checks on github.ref, and simple regexes such as /^release-/ become startsWith(). Your own variables are read from GitHub repository variables (vars.NAME). When a rule can't be rewritten, the job is set to run only when you start the workflow by hand, so a deploy never fires by accident, and the notes say which rule it was.
How is when: manual handled?
GitHub has no manual jobs inside an automatic run. A manual job is converted to run only when someone starts the workflow from the Actions tab (workflow_dispatch), still limited to the branches its rules or only: allowed. If what you really want is an approval before a deployment, add required reviewers to the job's GitHub environment instead.
Will values like long IDs, zip codes or dates change?
No. Variables keep the exact text you typed, so 8901240544102066246, 00501, 14.50, yes and 2024-01-15 come out unchanged, quoted where a YAML reader would otherwise turn them into a number, boolean or date. Script lines are copied character for character.
Why do my scripts still mention $CI_COMMIT_SHA?
Script text is never rewritten, and GitHub does not set GitLab's predefined variables. The notes at the top of the workflow list each one with its GitHub counterpart, such as $GITHUB_SHA for $CI_COMMIT_SHA and $GITHUB_REF_NAME for $CI_COMMIT_BRANCH. Inside variables: values, the ones with an exact match are switched to ${{ github.* }} expressions for you.
What is not converted?
include: files (they are not in what you paste), trigger jobs for child pipelines, runner tags, retry, coverage, artifact reports, changes: conditions and GitLab project variables stored in settings. Each one is listed in the comment block with the job it came from, so nothing disappears quietly.
Is my pipeline uploaded anywhere?
No. The conversion runs in your browser, nothing is sent to a server or kept, and a reload starts you off with an empty editor.
Coming from another CI service? There are converters for Bitbucket Pipelines, CircleCI, Travis CI and Azure Pipelines, and one for the opposite trip, GitHub Actions to GitLab CI.
Related Tools
Jenkins to GitHub Actions
Convert Jenkins pipelines (Jenkinsfile) to GitHub Actions workflows — stages, parallel stages, when-conditions, post blocks and environment become jobs and steps, and anything it can't convert is listed in notes
CI/CD Pipeline Fixer
Fix broken CI/CD pipeline configurations automatically, repair GitHub Actions, GitLab CI, Jenkins, and Azure Pipelines YAML errors
CircleCI to GitHub Actions
Convert CircleCI config.yml to GitHub Actions workflows with jobs, caching, and artifacts
Azure Pipelines to GitHub Actions
Convert Azure Pipelines YAML to GitHub Actions workflows with jobs, tasks, and stages
Travis CI to GitHub Actions
Convert .travis.yml to GitHub Actions workflows with language support, caching, and lifecycle hooks
GitHub Actions to GitLab CI
Convert GitHub Actions workflows to GitLab CI configuration with jobs, stages, and rules