Skip to content

Automated migration of Git repositories from Azure DevOps Services to GitHub using GitHub Actions.

License

Notifications You must be signed in to change notification settings

leandromsft/migrate-repo-from-ado-to-github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Migrate Repos from Azure DevOps Services to GitHub

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.

📢 Public Announcements

🛠️ Prerequisites

You must have the following secrets configured in your repository:

  • GH_PAT: GitHub Personal Access Token with repo and workflow permissions
  • ADO_PAT: Azure DevOps Personal Access Token with access to the source repo

🔄 Workflow: Migration

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.

📋 How to Use

  1. Open an issue and fill out the migration form with the required Azure DevOps details.
  2. Add the label repo to the issue.
  3. Review the information in the issue. If everything is correct, add a comment with the keyword approved to trigger the migration workflow.
  4. The workflow will run automatically and post the migration result as a comment in the issue.
  5. Download the logs artifact from the workflow run for detailed troubleshooting.

⚙️ Workflow Steps

  1. Parse Form Fields: Extracts migration parameters from the issue form (organization, team project, repository name).
  2. Set Variables: Normalizes and sets variables for Azure DevOps and GitHub organizations, projects, and repository names.
  3. Install Extension: Installs the gh-ado2gh GitHub CLI extension.
  4. Migrate Repo: Runs the migration command, saving the execution log to migration_exec.log.
  5. Download Logs: Downloads additional logs generated by the migration process.
  6. Upload Logs Artifact: Uploads all .log files as a workflow artifact (migration-logs).
  7. Comment Issue: Automatically comments on the triggering issue with the migration status and execution log. Status messages:
    • ❌ Migration failed if the log contains [ERROR]
    • ⚠️ Review migration if the log contains [WARNING]
    • ✅ Migration successful otherwise
  8. Add Topic to Migrated Repo: Automatically adds the topic migrate-from-ado to the successfully migrated GitHub repository for easy identification and filtering. This step only executes if the migration completes without errors.
  9. Disable ADO Repo: Disables the source Azure DevOps repository after migration.

🧩 Troubleshooting

  • Check the issue comment for migration status and log details.
  • Download the migration-logs artifact for all logs generated during the process.
  • Ensure your tokens have the correct permissions and the issue is properly labeled and commented.

📊 Workflow: Inventory Report

The inventory-report workflow manages the automated generation and analysis of Azure DevOps inventory to support migration planning to GitHub.

📋 How to Use

  1. Go to GitHub Actions and manually run the inventory-report workflow, providing the Azure DevOps organization name.
  2. The workflow will generate inventory CSV files and an AI-powered analysis report.
  3. Download the generated artifacts for detailed analysis and migration planning.

⚙️ Workflow Steps

  1. Install gh-ado2gh extension: Installs the official extension for ADO to GitHub migration.
  2. Generate inventory: Runs gh ado2gh inventory-report to collect organization data and generates CSV files: orgs.csv, team-projects.csv, repos.csv, pipelines.csv.
  3. Prepare CSV data for AI analysis: Reads CSV file contents and prepares environment variable for analysis.
  4. Analyze CSVs with AI: Uses GitHub Actions AI to analyze data and generate a detailed executive report.
  5. Create analysis report: Generates analysis-report.md file with AI analysis result.
  6. Upload artifacts: Exports CSV files, analysis report, and logs as artifacts.
  7. Job summary: Generates execution summary in GitHub Actions.

🧩 Troubleshooting

  • Check the workflow run summary and analysis report for details and recommendations.
  • Download the inventory-report, analysis-reports, and report-logs artifacts for all generated files and logs.
  • Ensure your tokens have the correct permissions and the workflow input is properly provided.

📦 Generated Artifacts

  • inventory-report (CSVs)
  • analysis-reports (markdown report)
  • report-logs (execution logs)

🤝 Contributing

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.

About

Automated migration of Git repositories from Azure DevOps Services to GitHub using GitHub Actions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published