gh actions-importer tool translates pipeline stages and steps into a GitHub Actions workflow file.

Source Jenkins Pipeline (pipeline portion of config.xml)
For this demo we used the Pipeline Project 2 located underFolder One → Folder Two. Below is the pipeline stage structure (scripted/declarative) from the job’s config.xml:
Dry-run vs Migrate
- Dry-run: translates and writes workflow files locally without modifying the target repository or creating pull requests.
- Migrate: performs a full migration and can push changes to a target repo or open PRs.
gh actions-importer subcommands for both operations.
Example: Full migration command
:owner and :repo with your GitHub organization/user and repository.
Example: Dry-run command used in this lesson
This dry-run writes translated workflows totmp/dry-run without pushing anything:
Actual dry-run invocation (console output)
The demo’s console output shows the dry-run invocation and the generated output path:Generated workflow (abridged)
After the dry-run, the importer created a GitHub Actions workflow YAML. The converter successfully mappedecho statements to run steps and injected a checkout step. Jenkins sleep calls did not have a built-in transformer and are emitted as commented placeholders:
What the importer did (summary)
| Jenkins construct | Result in converted workflow | Action required |
|---|---|---|
echo | Converted to - run: echo ... steps | No action needed |
checkout (implicit) | Added via actions/checkout@v4.1.0 | No action needed |
sleep | Emitted as commented placeholder (# This item has no matching transformer) | Create a custom transformer or manually update workflow |
config.xml, converted XML to an intermediate JSON representation, applied configured transformers, and emitted workflow YAML. Transformers were found for echo but not for sleep, so sleep entries appear as comments.
The importer emits commented placeholders for Jenkins constructs that lack matching transformers. To retain or convert such steps (for example,
sleep), create a custom transformer that maps the Jenkins keyword/function to an equivalent GitHub Actions step (for instance, run: sleep 5). Custom transformers let you tailor conversions for team-specific pipeline usage.Before running a full
migrate:- Validate the dry-run output under
tmp/dry-runand manually review any commented placeholders. - Add or author transformers for unsupported keywords if you need automated conversions.
- Only push or open PRs after confirming the generated workflows are functionally equivalent.
Next steps
- Implement custom transformers for unsupported Jenkins constructs (e.g.,
sleep→run: sleep <time>). - Re-run the dry-run to verify the new transformers produce the desired workflow YAML.
- When satisfied, perform a full
migrateto apply workflows to your target GitHub repository or open PRs.
Links and references
- GitHub CLI (gh)
- GitHub Actions workflows documentation: https://docs.github.com/actions
- If you need a starting point for custom transformers, consult your
actions-importerplugin docs or source repository for transformer templates.