in src/gei/Commands/GrantMigratorRoleCommand.cs [47:80]
public async Task Invoke(string githubOrg, string actor, string actorType, bool verbose = false)
{
_log.Verbose = verbose;
_log.LogInformation("Granting migrator role ...");
_log.LogInformation($"GITHUB ORG: {githubOrg}");
_log.LogInformation($"ACTOR: {actor}");
actorType = actorType?.ToUpper();
_log.LogInformation($"ACTOR TYPE: {actorType}");
if (actorType is "TEAM" or "USER")
{
_log.LogInformation("Actor type is valid...");
}
else
{
_log.LogError("Actor type must be either TEAM or USER.");
return;
}
var githubApi = _githubApiFactory.Create();
var githubOrgId = await githubApi.GetOrganizationId(githubOrg);
var success = await githubApi.GrantMigratorRole(githubOrgId, actor, actorType);
if (success)
{
_log.LogSuccess($"Migrator role successfully set for the {actorType} \"{actor}\"");
}
else
{
_log.LogError($"Migrator role couldn't be set for the {actorType} \"{actor}\"");
}
}