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.
-
Installez le GitHub CLI.
- Pour obtenir des instructions d’installation pour GitHub CLI, consultez le dépôt GitHub CLI.
- Si vous avez GitHub CLI déjà installé, exécutez
gh --versionpour vous assurer que vous exécutez la version 2.4.0 ou ultérieure. Si vous avez une version antérieure, consultez le GitHub CLI référentiel pour obtenir des instructions de mise à niveau.
-
Installez le ADO2GH extension.
Shell gh extension install github/gh-ado2gh
gh extension install github/gh-ado2gh -
La ADO2GH extension of the GitHub CLI est mise à jour chaque semaine. Pour être sûr d’utiliser la version la plus récente, mettez à jour l’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. -
Définissez le personal access token comme variable d’environnement, en remplaçant TOKEN dans les commandes ci-dessous par le personal access token que vous avez enregistré ci-dessus.
-
Si vous utilisez le Terminal, utilisez la commande
export.Shell export GH_PAT="TOKEN"
export GH_PAT="TOKEN" -
Si vous utilisez PowerShell, utilisez la commande
$env.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 TYPERemarque
Si vous accordez le rôle de migration pour GHE.com, vous devez également inclure l’URL de l’API cible pour le sous-domaine de votre entreprise. Par exemple :
--target-api-url https://api.octocorp.ghe.com.