Skip to main 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 GL2GH extension of the GitHub CLI.

  1. Install the GitHub CLI.

    • Инструкции по установке для GitHub CLI см. в репозитории GitHub CLI.
    • If you already have GitHub CLI installed, run gh --version to ensure you're running version 2.4.0 or newer. If you have an older version, visit the GitHub CLI repository for upgrade instructions.
  2. Install the GL2GH extension.

    Shell
    gh extension install github/gh-gl2gh
    
  3. The GL2GH extension of the GitHub CLI is updated frequently. Чтобы убедиться, что вы используете последнюю версию, обновите расширение.

    Shell
    gh extension upgrade github/gh-gl2gh
    
  4. On GitHub, create and record a personal access token that has the admin:org scope.

  5. Задайте для personal access token в качестве переменной среды, заменив TOKEN в командах ниже personal access token, записанных выше.

    • Если вы используете терминал, используйте export команду.

      Shell
      export GH_PAT="TOKEN"
      
    • Если вы используете PowerShell, используйте $env команду.

      Shell
      $env:GH_PAT="TOKEN"
      
  6. Use the gh gl2gh 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 gl2gh grant-migrator-role --github-org ORGANIZATION --actor ACTOR --actor-type TYPE
    

    Примечание.

    Если вы предоставляете роль миграции для GHE.com, необходимо также включить URL-адрес целевого API для поддомена вашего предприятия. Например: --target-api-url https://api.octocorp.ghe.com.