Skip to main content
Skip to content

Granting the migrator role

The migrator role gives a user or team the ability to run migrations on behalf of an organization.

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.

  1. 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 --version pour 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.
  2. Installez le ADO2GH extension.

    Shell
    gh extension install github/gh-ado2gh
    
  3. 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
    
  4. On GitHub, create and record a personal access token that has the admin:org scope.

  5. 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"
      
    • Si vous utilisez PowerShell, utilisez la commande $env.

      Shell
      $env:GH_PAT="TOKEN"
      
  6. Use the gh ado2gh grant-migrator-role command, replacing ORGANIZATION with the organization you want to grant the migrator role for, ACTOR with the user or team name, and TYPE with USER or TEAM.

    Shell
    gh ado2gh grant-migrator-role --github-org ORGANIZATION --actor ACTOR --actor-type TYPE
    

    Remarque

    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.