DevTools Logo

Jenkinsfile to GitHub Actions Converter

Jenkinsfile to GitHub Actions Converter

Translate declarative pipelines to workflow YAML with honest mapping notes.

Runs in your browser
Try an example

Jenkinsfile

18 lines · 258 chars

Conversion result

declarative · 2 stages · 1 unmapped
# Generated from a Jenkinsfile — review before using in CI.
name: "CI"
on:
  push:
  pull_request:
jobs:
  build:
    runs-on: "ubuntu-latest"
    steps:
      - uses: "actions/checkout@v4"
      - name: "Build: echo Building the app"
        run: "echo Building the app"
      - name: "Build: npm ci && npm run build"
        run: "npm ci && npm run build"
      - name: "Test: npm test"
        run: "npm test"
1 construct(s) need manual review. Open the Unmapped tab for line numbers.

Details

This converter parses declarative Jenkins pipeline blocks — agent, environment, stages, steps, when, post, triggers and parameters — and emits a GitHub Actions workflow. Common steps such as sh, echo and checkout scm map directly; credentials become secret references; plugin-specific calls such as junit and slackSend are reported with line numbers and suggested manual actions. Scripted pipelines are detected and converted best-effort with a partial badge. The Jenkinsfile never leaves the browser.

More examples

Build and test pipeline

pipeline { agent any; stages { stage('Build') { steps { sh 'npm run build' } } } }

Produces a workflow with checkout, a build step and name mapping notes.

Branch condition

when { branch 'main' }

Becomes an if condition comparing github.ref to refs/heads/main.

Credential binding

environment { TOKEN = credentials('deploy-token') }

Becomes a secret reference with a note prompting you to name the repository secret.

Examples

Build and test

Input
stage('Build') { steps { sh 'npm run build' } }
Output
- name: Build: npm run build
  run: "npm run build"

The stage name is preserved in the step name so the mapping stays readable.

Deploy only on main

Input
when { branch 'main' }
Output
if: "github.ref == 'refs/heads/main'"

Branch conditions map to a github.ref comparison.

Unmapped plugin step

Input
junit 'reports/*.xml'
Output
Unmapped: line 7 — add a test-report action

The step is reported rather than silently dropped.

About this tool

Jenkinsfile to GitHub Actions Converter translates declarative Jenkins pipelines into workflow YAML. It reads agent, environment, stages, steps, when, post, triggers and parameters blocks, then emits a jobs.build workflow with checkout, run steps, conditions and a runs-on target derived from the agent label.

Every recognised step produces a mapping note showing the Jenkins construct and its Actions counterpart. Plugin-specific steps that have no direct translation — junit, slackSend, stash, input, bat and others — are never guessed. They appear in the unmapped report with a line number, the reason and a suggested manual action, and are also commented in the generated YAML.

Scripted pipelines written with node { ... } are detected and converted best-effort with a prominent partial badge. Brace balancing rejects malformed input instead of emitting confidently wrong YAML. All parsing and emission happen in your browser tab; no pipeline text is uploaded.

What this tool does not do

  • Declarative pipelines are the target; scripted pipelines are best-effort only.
  • Groovy expressions, shared libraries and arbitrary plugin steps are not translated.
  • Output YAML is emitted by a small hand-rolled emitter and should be validated in your CI before use.
  • Secrets become placeholder references; no real secret value is ever requested or emitted.
  • Parallel stages and matrix expansion are reported rather than converted.

How to use this tool

  1. Paste a Jenkinsfile

    Use the sample pipeline or paste your own declarative pipeline into the editor.

  2. Set conversion options

    Choose the workflow name, default runner and action version. Agent labels are mapped through a small built-in table.

  3. Review the three tabs

    Inspect workflow.yaml, the stage-by-stage mapping notes and the unmapped report with line numbers.

  4. Copy and iterate

    Copy or download the YAML into .github/workflows/ci.yml, then handle the unmapped items manually.

Use cases

CI migration waves

Turn a backlog of Jenkinsfiles into first-draft workflows for review.

Migration documentation

Export mapping notes to show which constructs need human attention.

Consulting hand-offs

Give clients a transparent conversion with an explicit unmapped list.

Step translations

JenkinsGitHub Actions
sh 'cmd'run: cmd
echo 'text'run: echo text
checkout scmuses: actions/checkout@v4
branch 'main'if: github.ref == 'refs/heads/main'
post { always { ... } }step with if: always()
credentials('id')env with ${{ secrets.ID }} plus a TODO note

Action versions are configurable constants; review them against current releases.

Common mistakes

Mistake:Treating the output as production-ready without review.

Fix:Work through every unmapped item and verify action versions before committing.

Mistake:Expecting Groovy variables and shared libraries to translate.

Fix:They are reported as unmapped; rewrite them as Actions expressions or environment values.

Mistake:Forgetting that post conditions differ in meaning.

Fix:aborted and unstable are approximated with failure(); add custom logic if the distinction matters.

Mistake:Using a runner label that is not in the mapping table.

Fix:Set the default runner field to the label your GitHub-hosted or self-hosted runners use.

Mistake:Pasting a scripted pipeline and expecting a perfect conversion.

Fix:Expect a partial badge and review every step; declarative pipelines convert most faithfully.

Frequently asked questions

Which pipeline types are supported?

Declarative pipelines with pipeline { ... } are the primary target: agent, environment, stages, steps, when, post, triggers and parameters are parsed. Scripted node { ... } pipelines are detected and converted best-effort with a partial badge and a leading unmapped note.

How are credentials mapped?

credentials('id') becomes an environment reference to a GitHub Actions secret, with the name normalised to uppercase. The tool never asks for the secret value and adds a note reminding you to create the matching repository secret.

What happens to post conditions?

always, success, failure and cleanup map to steps with if: always(), success(), failure() or failure(). aborted and unstable have no direct equivalent, so they are emitted with failure() and an explicit unmapped note.

Can scripted pipelines convert?

Only partially. The tool finds stage('name') blocks and translates recognisable shell steps, but Groovy control flow and shared libraries cannot be translated safely. Treat the output as a starting point.

Are shared libraries translated?

No. @Library calls and custom Groovy functions are reported in the unmapped list with their line number so you can replace them with Actions steps or composite actions.

Is my Jenkinsfile uploaded?

No. Parsing, mapping and YAML emission all run in your browser. Nothing is sent to a server, and the generated YAML contains no secret values.

References & standards