To allow someone other than an organization owner to run a migration or download migration logs, you can grant the migrator role to a user or team.
To grant the migrator role using the CLI, you can use the ADO2GH extension of the GitHub CLI.
-
Install the GitHub CLI.
- For installation instructions for GitHub CLI, see the GitHub CLI repository.
- If you already have GitHub CLI installed, run
gh --versionto ensure you're running version 2.4.0 or newer. If you have an older version, visit the GitHub CLI repository for upgrade instructions.
-
Install the ADO2GH extension.
Shell gh extension install github/gh-ado2gh
gh extension install github/gh-ado2gh -
The ADO2GH extension of the GitHub CLI is updated weekly. To make sure you're using the latest version, update the extension.
Shell gh extension upgrade github/gh-ado2gh
gh extension upgrade github/gh-ado2gh -
On GitHub, create and record a personal access token that has the
admin:orgscope. -
Set the personal access token as an environment variable, replacing TOKEN in the commands below with the personal access token you recorded above.
-
If you're using Terminal, use the
exportcommand.Shell export GH_PAT="TOKEN"
export GH_PAT="TOKEN" -
If you're using PowerShell, use the
$envcommand.Shell $env:GH_PAT="TOKEN"
$env:GH_PAT="TOKEN"
-
-
Use the
gh ado2gh grant-migrator-rolecommand, replacing ORGANIZATION with the organization you want to grant the migrator role for, ACTOR with the user or team name, and TYPE withUSERorTEAM.Shell gh ado2gh grant-migrator-role --github-org ORGANIZATION --actor ACTOR --actor-type TYPE
gh ado2gh grant-migrator-role --github-org ORGANIZATION --actor ACTOR --actor-type TYPENote
If you're the granting the migrator role for GHE.com, you must also include the target API URL for your enterprise's subdomain. For example:
--target-api-url https://api.octocorp.ghe.com.