GitHub CLI Extension.
This is a wrapper tool to GitHub Enterprise Importer that orchestrate necessary steps between GitHub's GEI repository migration and GHAS secret and code scanning migrations.
It is a collection of scripts that can be used to help with the migration process by wrapping GEI commands and performing pre and post-migration changes
the GEI Migration Helper can be installed via this command:
$ gh extension install gateixeira/gh-gei-migration-helper
Run the tool via command line:
$ gh gei-migration-helper --help
Read all repositories from source organization and for each repository:
- Deactivate GitHub Advanced Security features at source repository if enabled
- Disable workflows at source repository, if any
- Migrate repository to target organization
- Delete branch protections at target (To be removed in a later version)
- If repository is internal at source it should be reset to internal at target after migration
- Activate GitHub Advanced Security at target
- Reactivate GitHub Advanced Security at source
- Migrate code scanning alerts
- Re-enable workflows at source, if any
- Archive source repository
- Download the GitHub CLI
- Install the GEI extension
- Create a personal access token for the source and target organization according to these scopes
- Run the migration helper scripts
migrate-organization
to migrate all repositories in an organization- Wait for secret scanning to execute on the target organization
migrate-secret-scanning
to migrate secret scanning resultsreactivate-target-workflow
to reactivate workflows at target that were deactivated during the migration process
This script can be used to migrate all repositories in an organization
$ gh gh-gei-migration-helper migrate-organization --source-org <source_org> --target-org <target_org> --source-token <source_token> --target-token <target_token>
This script can be used to migrate a single repository
$ gh gh-gei-migration-helper migrate-repository --repo <repository_name> --source-org <source_org> --target-org <target_org> --source-token <source_token> --target-token <target_token>
Wrapper to migrate secret scan results. It migrates for all repositories in an org if no --repo
is provided.
$ gh gh-gei-migration-helper migrate-secret-scanning --repo <repository_name> --source-org <source_org> --target-org <target_org> --source-token <source_token> --target-token <target_token>
Resets the target repository workflows to their original state. It reactivates all workflows that were deactivated during the migration process.
Omit the repository flag to run against the whole organization.
$ gh gh-gei-migration-helper reactivate-target-workflow --source-org <source_org> --target-org <target_org> --source-token <source_token> --target-token <target_token>