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.
-
Install the GitHub CLI.
- GitHub CLI のインストール手順については、GitHub CLI リポジトリを参照してください。
- 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 GL2GH extension.
Shell gh extension install github/gh-gl2gh
gh extension install github/gh-gl2gh -
The GL2GH extension of the GitHub CLI is updated frequently. 最新バージョンを確実に使うため、拡張機能を更新してください。
Shell gh extension upgrade github/gh-gl2gh
gh extension upgrade github/gh-gl2gh -
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 gl2gh 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 gl2gh grant-migrator-role --github-org ORGANIZATION --actor ACTOR --actor-type TYPE
gh gl2gh grant-migrator-role --github-org ORGANIZATION --actor ACTOR --actor-type TYPEメモ
GHE.com の移行者ロールを付与する場合は、エンタープライズのサブドメインのターゲット API URL も含める必要があります。 (例:
--target-api-url https://api.octocorp.ghe.com)。