Loading Jenkins Converter...
How to Convert a Jenkinsfile to GitHub Actions
Input Your Jenkinsfile
Start with the Jenkinsfile from your repository. The converter reads the declarative pipeline syntax (pipeline { agent … stages { … } }); scripted node { … } pipelines get a rougher conversion.
Example: a small declarative pipeline
pipeline {
agent { docker { image 'node:20' } }
environment {
ACCOUNT_ID = '8901240544102066246'
}
stages {
stage('Build') {
steps {
sh 'npm ci'
sh 'npm run build'
}
}
stage('Deploy') {
when { branch 'main' }
steps {
sh './deploy.sh $ACCOUNT_ID'
}
}
}
}Read the Converted Workflow
The workflow YAML shows up on the right a moment after you stop typing:
What the example above becomes
# Converted from a Jenkinsfile. Check these before you use the workflow:
# - Every stage is now its own job, and each job starts from a fresh checkout. Jenkins stages share one workspace, so files one stage builds for the next must be passed with artifacts (stash/unstash were converted to that), or those stages merged into one job.
name: CI
'on':
push:
branches:
- '**'
workflow_dispatch: {}
env:
ACCOUNT_ID: '8901240544102066246'
jobs:
Build:
name: Build
runs-on: ubuntu-latest
container:
image: node:20
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm run build
Deploy:
name: Deploy
needs: Build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
container:
image: node:20
steps:
- uses: actions/checkout@v4
- run: ./deploy.sh $ACCOUNT_IDWork Through the Notes
The comment block at the top is your to-do list:
Commit the Workflow
.github/workflows/ folder of your repository.Frequently Asked Questions
How do Jenkins stages turn into GitHub jobs?
Each stage becomes a job, and needs: keeps them in the same order. Stages inside parallel { } share the same needs, so they start together, and the next stage waits for all of them. Matrix stages become one job with strategy.matrix. Jenkins runs every stage in one workspace while GitHub gives each job a fresh checkout, so stash and unstash are turned into upload-artifact and download-artifact steps.
What happens to environment, credentials and parameters?
The pipeline's environment { } goes to the workflow-level env:, a stage's environment to that job. credentials('deploy-token') becomes ${{ secrets.DEPLOY_TOKEN }}, and the notes tell you which secret names to create. Parameters become workflow_dispatch inputs, and because Jenkins hands them to shell steps as variables, they are also set in env: with the default as a fallback for runs started by a push.
Are when conditions and post blocks converted?
branch, tag, buildingTag, changeRequest, environment, not, allOf, anyOf and simple expression { } checks on params or BRANCH_NAME become an if: on the job. A condition that can't be translated, such as a regular expression or changeset, switches the job off with if: false and says so, rather than letting a deploy run on every branch. post { always / success / failure / aborted } become steps with always(), success(), failure() or cancelled(); the pipeline's own post block becomes a job that waits for the others.
What about script { } blocks, shared libraries and scripted pipelines?
A script { } block that only calls sh or echo is converted like any other step. One with real Groovy logic (def, if, loops) becomes a TODO step whose run text shows the original code as comments, because Groovy cannot run on a GitHub runner. Shared-library steps, input, build job: and notifications become TODO placeholders too. Scripted pipelines written as node { stage(...) { ... } } get a best-effort conversion with the same rules.
Will values like long IDs, zip codes or prices change?
No. Strings are copied exactly as Groovy reads them, so 8901240544102066246, 00501, 14.50 and yes come out unchanged and are quoted in the YAML where a reader would otherwise turn them into numbers or booleans. sh scripts keep their commands; Groovy ${...} interpolation of variables becomes a shell ${NAME}, and Jenkins variables such as BUILD_NUMBER or BRANCH_NAME are set from the matching GitHub values.
Is my Jenkinsfile uploaded anywhere?
No. The conversion runs in your browser; nothing is sent to a server or kept, and a reload starts with an empty editor.
Moving from another CI service? There are converters for GitLab CI, CircleCI, Bitbucket Pipelines, Travis CI and Azure Pipelines, and GitHub Actions to GitLab CI goes the other way.
Related Tools
GitLab CI to GitHub Actions
Convert GitLab CI/CD pipelines to GitHub Actions workflows with jobs, artifacts, and variables
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