- Creating a Multi-branch Pipeline that discovers Jenkinsfiles in multiple branches.
- Indexing output from Jenkins showing discovered branches.
- Adding a secret via the job’s Environment → Bindings and using it in a shell step.
- Re-running the
gh actions-importer audit jenkinscommand and inspecting the updated audit summary and generated GitHub Actions workflow snippets.
- Jenkins Pipeline (Multibranch)
- GitHub Actions documentation
- gh actions-importer: use the tool’s CLI to audit and migrate Jenkins jobs to GitHub Actions.
Initial state: existing Jenkins jobs and previous audit
There were four Jenkins jobs discovered by the previous audit. One job was in a pending state (likely an agent issue); it was cancelled so it wouldn’t interfere with the demo. For reference, here is the trimmed audit summary from the previous run:Create a Multi-branch Pipeline
We created a new GitHub repojenkins-demo-org/demo-repo containing two branches: main and uat. Each branch contains a Jenkinsfile — main includes a single stage, while uat contains two stages. To add the multi-branch job in Jenkins, choose New Item → Multi-branch Pipeline and point the Branch Source to the GitHub repository.


uat containing Stage-2):


main branch showed a successful build:

Add a secret binding to an existing job
Next, we switched to an existing job (Generate ASCII Artwork) and added a secret via Configure → Environment → Bindings. We added a Secret text binding namedm_username and selected an existing stored credential (mongo-db-password) for the demo.


- Use
jqto extract structured JSON fields reliably. - Avoid printing secrets to logs in production — the example echoes the secret only for demonstration.
Re-run the audit
After saving the new multi-branch job and the updated job with a secret binding, we re-ran the audit to refresh the report and capture the new job and secret binding. Run the audit:Generated GitHub Actions workflow and secret mapping
The import tool redacted secrets and generated workflow YAML for the Jenkins jobs it can map. It detected them_username secret and mapped it to a repository/organization-level secret in the generated workflow. You (or a repo administrator) must create that secret in GitHub (repo/org/environment level) so the workflow can use it at runtime.
Example generated workflow snippet (secrets must be created in GitHub prior to running the workflow):
The audit tool maps many Jenkins credential types to GitHub Actions equivalents, but referenced secrets must be created in GitHub (repo/org/environment level) before the workflow runs.
That’s it for this lesson — the updated audit summary and generated artifacts reflect the newly added multi-branch pipeline and the secret binding added to the existing job.