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.
-
Установите GitHub CLI.
- Инструкции по установке для GitHub CLI см. в репозитории GitHub CLI.
- Если уже установлена GitHub CLI , запустите
gh --version, чтобы убедиться, что у вас версия 2.4.0 или новее. Если у вас более старая версия, посетите GitHub CLI репозиторий для инструкций по обновлению.
-
Установите ADO2GH extension.
Shell gh extension install github/gh-ado2gh
gh extension install github/gh-ado2gh -
Обновление ADO2GH extension of the GitHub CLI обновляется еженедельно. Чтобы убедиться, что вы используете последнюю версию, обновите расширение.
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. -
Задайте для personal access token в качестве переменной среды, заменив TOKEN в командах ниже personal access token, записанных выше.
-
Если вы используете терминал, используйте
exportкоманду.Shell export GH_PAT="TOKEN"
export GH_PAT="TOKEN" -
Если вы используете PowerShell, используйте
$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 TYPEПримечание.
Если вы предоставляете роль GHE.comмиграции для, необходимо также включить URL-адрес целевого API для поддомена предприятия. Например:
--target-api-url https://api.octocorp.ghe.com.