Automated migration of Git repositories from Azure DevOps Services to GitHub using GitHub Actions.
This automation uses the official GitHub tool: GitHub Enterprise Importer for migrating repositories from Azure DevOps to GitHub.
- Azure DevOps with GitHub Repositories – Your path to Agentic AI
- Accelerate innovation by migrating your repositories from Azure DevOps to GitHub
- Azure DevOps to GitHub migration Playbook: Unlocking Agentic DevOps
You must have the following secrets configured in your repository:
GH_PAT: GitHub Personal Access Token with repo and workflow permissionsADO_PAT: Azure DevOps Personal Access Token with access to the source repo
The migration process is managed by the workflow file .github/workflows/migrate-repo.yml. This workflow is triggered by comments on issues that have the label repo and contain the word approved.
- Open an
issueand fill out the migration form with the required Azure DevOps details. - Add the label
repoto the issue. - Review the information in the issue. If everything is correct, add a comment with the keyword
approvedto trigger the migration workflow. - The workflow will run automatically and post the migration result as a comment in the issue.
- Download the logs artifact from the workflow run for detailed troubleshooting.
- Parse Form Fields: Extracts migration parameters from the issue form (organization, team project, repository name).
- Set Variables: Normalizes and sets variables for Azure DevOps and GitHub organizations, projects, and repository names.
- Install Extension: Installs the
gh-ado2ghGitHub CLI extension. - Migrate Repo: Runs the migration command, saving the execution log to
migration_exec.log. - Download Logs: Downloads additional logs generated by the migration process.
- Upload Logs Artifact: Uploads all
.logfiles as a workflow artifact (migration-logs). - Comment Issue: Automatically comments on the triggering issue with the migration status and execution log. Status messages:
❌ Migration failedif the log contains[ERROR]⚠️ Review migrationif the log contains[WARNING]✅ Migration successfulotherwise
- Add Topic to Migrated Repo: Automatically adds the topic
migrate-from-adoto the successfully migrated GitHub repository for easy identification and filtering. This step only executes if the migration completes without errors. - Disable ADO Repo: Disables the source Azure DevOps repository after migration.
- Check the issue comment for migration status and log details.
- Download the
migration-logsartifact for all logs generated during the process. - Ensure your tokens have the correct permissions and the issue is properly labeled and commented.
The inventory-report workflow manages the automated generation and analysis of Azure DevOps inventory to support migration planning to GitHub.
- Go to GitHub Actions and manually run the
inventory-reportworkflow, providing the Azure DevOps organization name. - The workflow will generate inventory CSV files and an AI-powered analysis report.
- Download the generated artifacts for detailed analysis and migration planning.
- Install gh-ado2gh extension: Installs the official extension for ADO to GitHub migration.
- Generate inventory: Runs
gh ado2gh inventory-reportto collect organization data and generates CSV files:orgs.csv,team-projects.csv,repos.csv,pipelines.csv. - Prepare CSV data for AI analysis: Reads CSV file contents and prepares environment variable for analysis.
- Analyze CSVs with AI: Uses GitHub Actions AI to analyze data and generate a detailed executive report.
- Create analysis report: Generates
analysis-report.mdfile with AI analysis result. - Upload artifacts: Exports CSV files, analysis report, and logs as artifacts.
- Job summary: Generates execution summary in GitHub Actions.
- Check the workflow run summary and analysis report for details and recommendations.
- Download the
inventory-report,analysis-reports, andreport-logsartifacts for all generated files and logs. - Ensure your tokens have the correct permissions and the workflow input is properly provided.
inventory-report(CSVs)analysis-reports(markdown report)report-logs(execution logs)
This project is open for contributions! If you find any bugs or have suggestions for improvements, feel free to open an issue or submit a pull request.