Loading Jenkins Converter...

How to Convert a Jenkinsfile to GitHub Actions

Step 1

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.

•
Paste directly: copy the file into the input editor.
•
Upload file: click "Upload" and pick the Jenkinsfile from your computer.
•
Try sample: click "Sample" for a pipeline with a Docker agent, a credential, a cron trigger, parallel test stages and a deploy stage that only runs on main.

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'
            }
        }
    }
}
Step 2

Read the Converted Workflow

The workflow YAML shows up on the right a moment after you stop typing:

•
Stages to jobs: each stage is a job, chained with needs; parallel stages share the same needs.
•
Agents: agent any becomes ubuntu-latest, a docker agent becomes the job's container, and a label is listed in the notes.
•
Steps: sh, bat, echo, checkout, stash, archiveArtifacts, junit, dir, withEnv and withCredentials are mapped; scripts are copied as Groovy hands them to the shell.
•
Conditions: when and post become if: checks; triggers and parameters fill in the on: section.
•
Notes: anything that could not be translated is listed with its Jenkinsfile line number in a comment block at the top.

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_ID
Step 3

Work Through the Notes

The comment block at the top is your to-do list:

•
Secrets: create the repository secrets the notes name (Settings → Secrets and variables → Actions).
•
TODO steps: rewrite Groovy script blocks, shared-library calls and notifications as shell or marketplace actions.
•
Workspace: stages that hand files to each other either need artifacts or can be merged into one job.
•
Approvals: an input step is best replaced by a GitHub environment with required reviewers.
Step 4

Commit the Workflow

•
Download: click "Download" to save github-actions-workflow.yml.
•
Place it: put the file in the .github/workflows/ folder of your repository.
•
Push: commit and push; the first run appears on the Actions tab.

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.