{"meta":{"title":"Automating migration with GitHub Actions Importer","intro":"Use GitHub Actions Importer to plan and automate your migration to GitHub Actions.","product":"GitHub Actions","breadcrumbs":[{"href":"/en/actions","title":"GitHub Actions"},{"href":"/en/actions/tutorials","title":"Tutorials"},{"href":"/en/actions/tutorials/migrate-to-github-actions","title":"Migrate to GitHub Actions"},{"href":"/en/actions/tutorials/migrate-to-github-actions/automated-migrations","title":"Automated migrations"},{"href":"/en/actions/tutorials/migrate-to-github-actions/automated-migrations/use-github-actions-importer","title":"Use GitHub Actions Importer"}],"documentType":"article"},"body":"# Automating migration with GitHub Actions Importer\n\nUse GitHub Actions Importer to plan and automate your migration to GitHub Actions.\n\n## About GitHub Actions Importer\n\nYou can use GitHub Actions Importer to plan and automatically migrate your CI/CD supported pipelines to GitHub Actions.\n\nGitHub Actions Importer is distributed as a Docker container, and uses a [GitHub CLI](https://cli.github.com) extension to interact with the container.\n\nAny workflow that is converted by the GitHub Actions Importer should be inspected for correctness before using it as a production workload. The goal is to achieve an 80% conversion rate for every workflow, however, the actual conversion rate will depend on the makeup of each individual pipeline that is converted.\n\n## Supported CI platforms\n\nYou can use GitHub Actions Importer to migrate from the following platforms:\n\n* Azure DevOps\n* Bamboo\n* Bitbucket Pipelines\n* CircleCI\n* GitLab (both cloud and self-hosted)\n* Jenkins\n* Travis CI\n\n## Prerequisites\n\nGitHub Actions Importer has the following requirements:\n\n* An environment where you can run Linux-based containers, and can install the necessary tools.\n  * Docker is [installed](https://docs.docker.com/get-docker/) and running.\n  * [GitHub CLI](https://cli.github.com) is installed.\n\n  > [!NOTE]\n  > The GitHub Actions Importer container and CLI do not need to be installed on the same server as your CI platform.\n\n### Installing the GitHub Actions Importer CLI extension\n\n1. Install the GitHub Actions Importer CLI extension:\n\n   ```bash copy\n   gh extension install github/gh-actions-importer\n   ```\n\n1. Verify that the extension is installed:\n\n   ```bash\n   $ gh actions-importer -h\n   Options:\n     -?, -h, --help  Show help and usage information\n\n   Commands:\n     update     Update to the latest version of GitHub Actions Importer.\n     version    Display the version of GitHub Actions Importer.\n     configure  Start an interactive prompt to configure credentials used to authenticate with your CI server(s).\n     audit      Plan your CI/CD migration by analyzing your current CI/CD footprint.\n     forecast   Forecast GitHub Actions usage from historical pipeline utilization.\n     dry-run    Convert a pipeline to a GitHub Actions workflow and output its yaml file.\n     migrate    Convert a pipeline to a GitHub Actions workflow and open a pull request with the changes.\n   ```\n\n### Updating the GitHub Actions Importer CLI\n\nTo ensure you're running the latest version of GitHub Actions Importer, you should regularly run the `update` command:\n\n```bash\ngh actions-importer update\n```\n\n### Authenticating at the command line\n\nYou must configure credentials that allow GitHub Actions Importer to communicate with GitHub and your current CI server. You can configure these credentials using environment variables or a `.env.local` file. The environment variables can be configured in an interactive prompt, by running the following command:\n\n```bash\ngh actions-importer configure\n```\n\n## Using the GitHub Actions Importer CLI\n\nUse the subcommands of `gh actions-importer` to begin your migration to GitHub Actions, including `audit`, `forecast`, `dry-run`, and `migrate`.\n\n### Auditing your existing CI pipelines\n\nThe `audit` subcommand can be used to plan your CI/CD migration by analyzing your current CI/CD footprint. This analysis can be used to plan a timeline for migrating to GitHub Actions.\n\nTo run an audit, use the following command to determine your available options:\n\n```bash\n$ gh actions-importer audit -h\nDescription:\n  Plan your CI/CD migration by analyzing your current CI/CD footprint.\n\n[...]\n\nCommands:\n  azure-devops  An audit will output a list of data used in an Azure DevOps instance.\n  bamboo        An audit will output a list of data used in a Bamboo instance.\n  circle-ci     An audit will output a list of data used in a CircleCI instance.\n  gitlab        An audit will output a list of data used in a GitLab instance.\n  jenkins       An audit will output a list of data used in a Jenkins instance.\n  travis-ci     An audit will output a list of data used in a Travis CI instance.\n```\n\n### Forecasting usage\n\nThe `forecast` subcommand reviews historical pipeline usage to create a forecast of GitHub Actions usage.\n\nTo run a forecast, use the following command to determine your available options:\n\n```bash\n$ gh actions-importer forecast -h\nDescription:\n  Forecasts GitHub Actions usage from historical pipeline utilization.\n\n[...]\n\nCommands:\n  azure-devops  Forecasts GitHub Actions usage from historical Azure DevOps pipeline utilization.\n  bamboo        Forecasts GitHub Actions usage from historical Bamboo pipeline utilization.\n  jenkins       Forecasts GitHub Actions usage from historical Jenkins pipeline utilization.\n  gitlab        Forecasts GitHub Actions usage from historical GitLab pipeline utilization.\n  circle-ci     Forecasts GitHub Actions usage from historical CircleCI pipeline utilization.\n  travis-ci     Forecasts GitHub Actions usage from historical Travis CI pipeline utilization.\n  github        Forecasts GitHub Actions usage from historical GitHub pipeline utilization.\n```\n\n### Testing the migration process\n\nThe `dry-run` subcommand can be used to convert a pipeline to its GitHub Actions equivalent, and then write the workflow to your local filesystem.\n\nTo perform a dry run, use the following command to determine your available options:\n\n```bash\n$ gh actions-importer dry-run -h\nDescription:\n  Convert a pipeline to a GitHub Actions workflow and output its yaml file.\n\n[...]\n\nCommands:\n  azure-devops  Convert an Azure DevOps pipeline to a GitHub Actions workflow and output its yaml file.\n  bamboo        Convert a Bamboo pipeline to GitHub Actions workflows and output its yaml file.\n  circle-ci     Convert a CircleCI pipeline to GitHub Actions workflows and output the yaml file(s).\n  gitlab        Convert a GitLab pipeline to a GitHub Actions workflow and output the yaml file.\n  jenkins       Convert a Jenkins job to a GitHub Actions workflow and output its yaml file.\n  travis-ci     Convert a Travis CI pipeline to a GitHub Actions workflow and output its yaml file.\n```\n\n### Migrating a pipeline to GitHub Actions\n\nThe `migrate` subcommand can be used to convert a pipeline to its GitHub Actions equivalent and then create a pull request with the contents.\n\nTo run a migration, use the following command to determine your available options:\n\n```bash\n$ gh actions-importer migrate -h\nDescription:\n  Convert a pipeline to a GitHub Actions workflow and open a pull request with the changes.\n\n[...]\n\nCommands:\n  azure-devops  Convert an Azure DevOps pipeline to a GitHub Actions workflow and open a pull request with the changes.\n  bamboo        Convert a Bamboo pipeline to GitHub Actions workflows and open a pull request with the changes.\n  circle-ci     Convert a CircleCI pipeline to GitHub Actions workflows and open a pull request with the changes.\n  gitlab        Convert a GitLab pipeline to a GitHub Actions workflow and open a pull request with the changes.\n  jenkins       Convert a Jenkins job to a GitHub Actions workflow and open a pull request with the changes.\n  travis-ci     Convert a Travis CI pipeline to a GitHub Actions workflow and open a pull request with the changes.\n```\n\n## Performing self-serve migrations using IssueOps\n\nYou can use GitHub Actions and GitHub Issues to run CLI commands for GitHub Actions Importer. This allows you to migrate your CI/CD workflows without installing software on your local machine. This approach is especially useful for organizations that want to enable self-service migrations to GitHub Actions. Once IssueOps is configured, users can open an issue with the relevant template to migrate pipelines to GitHub Actions.\n\nFor more information about setting up self-serve migrations with IssueOps, see the [`actions/importer-issue-ops`](https://github.com/actions/importer-issue-ops) template repository.\n\n## Using the GitHub Actions Importer labs repository\n\nThe GitHub Actions Importer labs repository contains platform-specific learning paths that teach you how to use GitHub Actions Importer and how to approach migrations to GitHub Actions. You can use this repository to learn how to use GitHub Actions Importer to help plan, forecast, and automate your migration to GitHub Actions.\n\nTo learn more, see the [GitHub Actions Importer labs repository](https://github.com/actions/importer-labs/tree/main#readme).\n\n## Legal notice\n\nPortions have been adapted from https://github.com/github/gh-actions-importer/ under the MIT license:\n\n```text\nMIT License\n\nCopyright (c) 2022 GitHub\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```"}