Demo Installing the GitHub Actions Importer CLI Extension
Guide to install and authenticate the GitHub CLI extension ‘gh-actions-importer’, configure Jenkins credentials, and run audit, dry-run, forecast, and migrate commands to convert Jenkins pipelines to GitHub Actions.
root@jenkins in /home❯ ghbash: /usr/bin/gh: No such file or directory
If the command returns “No such file or directory,” install gh on Debian/Ubuntu using the official repository and keyring. This single-line script adds the repository, imports the GPG keyring, updates apt, and installs gh:
After installation, validate gh and inspect available top-level commands:
root@jenkins in /home❯ gh helpCORE COMMANDS auth Authenticate gh and git with GitHub browse Open repositories, issues, pull requests, and more in the browser codespace Connect to and manage codespaces gist Manage gists issue Manage issues org Manage organizations pr Manage pull requests project Work with GitHub Projects release Manage releases repo Manage repositoriesGITHUB ACTIONS COMMANDS cache Manage GitHub Actions caches run View details about workflow runs workflow View details about GitHub Actions workflowsADDITIONAL COMMANDS alias Create command shortcuts api Make an authenticated GitHub API request completion Generate shell completion scripts config Manage configuration for gh
root@jenkins in /home❯ gh extension install github/gh-actions-importerTo get started with GitHub CLI, please run: gh auth loginAlternatively, populate the GH_TOKEN environment variable with a GitHub API authentication token.
If gh is not authenticated, it will prompt you to authenticate first. Continue to the authentication section below.
Interactive login: gh auth login (recommended for interactive sessions)
Environment token: set GH_TOKEN to a Personal Access Token (PAT) to allow non-interactive usage
Interactive login example:
root@jenkins in /home❯ gh auth login? Where do you use GitHub? GitHub.com? What is your preferred protocol for Git operations on this host? HTTPS? How would you like to authenticate GitHub CLI? Paste an authentication tokenTip: you can generate a Personal Access Token at https://github.com/settings/tokensThe minimum required scopes are: 'repo', 'read:org', 'workflow'.? Paste your authentication token:
Generate a PAT in GitHub: Settings → Developer settings → Personal access tokens (classic). When creating the token, grant the importer the minimum required scopes.
Minimum required scopes for the importer are: repo, read:org, and workflow. Keep the token secure and consider setting an expiration.
To make scope/permissions clear, here’s a quick reference:
Scope
Why it’s required
repo
Read/write access to repository contents (needed for creating PRs during migrations)
read:org
Read organization membership & teams if importer needs org-level context
workflow
Inspect and manage GitHub Actions workflows
When you finish the interactive gh auth login flow, you should see confirmation:
root@jenkins in /home❯ gh auth login... (authentication steps) ...✓ Configured git protocol! Authentication credentials saved in plain text✓ Logged in as <your-github-username>
Verify status:
root@jenkins in /home❯ gh auth statusgithub.com ✓ Logged in to github.com as <your-github-username> (oauth_token) ✓ Git operations for github.com configured to use https protocol.
root@jenkins in /home❯ gh actions-importer -hOptions: -?, -h, --help Show help and usage informationCommands: update Update to the latest version of GitHub Actions Importer. version Display the current version of GitHub Actions Importer. configure Start an interactive prompt to configure credentials used to authenticate with your CI server(s). audit Plan your CI/CD migration by analyzing your current CI/CD footprint. forecast Forecast GitHub Actions usage from historical pipeline utilization. dry-run Convert a pipeline to a GitHub Actions workflow and output its YAML file. migrate Convert a pipeline to a GitHub Actions workflow and open a pull request with the changes. list-features List the available feature flags for GitHub Actions Importer.
Run the interactive configuration to store CI provider credentials and base URLs:
root@jenkins in /home❯ gh actions-importer configure✓ Which CI providers are you configuring?: JenkinsEnter the following values (leave empty to omit):✓ Personal access token for GitHub: ***************✓ Base url of the GitHub instance: https://github.com✓ Personal access token for Jenkins: ***************✓ Username of Jenkins user: admin✓ Base url of the Jenkins instance: https://localhostEnvironment variables successfully updated.
After configuring, you can run the following high-value commands:
gh actions-importer audit — analyze your Jenkins CI/CD footprint and identify migration candidates
gh actions-importer forecast — estimate GitHub Actions usage from historical pipeline data
gh actions-importer dry-run — convert a pipeline and output workflow YAML without creating changes
gh actions-importer migrate — convert a pipeline and open a pull request with the resulting workflow
Inspect feature toggles that control importer behavior:
root@jenkins in /home❯ gh actions-importer list-featuresAvailable feature toggles:actions/cache (enabled): Control usage of actions/cache inside of workflows. Outputs a comment if not enabled. GitHub Enterprise Server >= ghes-3.5 required.composite-actions (enabled): Minimizes resulting workflow complexity through the use of composite actions. See https://docs.github.com/en/actions/creating-actions/creating-a-composite-action for more information. GitHub Enterprise Server >= ghes-3.4 required.reusable-workflows (enabled): Avoid duplication by reusing existing workflows. See https://docs.github.com/en/actions/using-workflows/reusing-workflows for more information.