{"meta":{"title":"管理访问权限","intro":"设置从 Azure DevOps 迁移到 GitHub所需的访问权限。","product":"迁移","breadcrumbs":[{"href":"/zh/migrations","title":"迁移"},{"href":"/zh/migrations/ado","title":"从Azure DevOps迁移"},{"href":"/zh/migrations/ado/manage-access","title":"2. 管理访问权限"}],"documentType":"article"},"body":"# 管理访问权限\n\n设置从 Azure DevOps 迁移到 GitHub所需的访问权限。\n\n若要将存储库从 Azure DevOps 迁移到 GitHub，需要对 **source**（Azure DevOps 上的组织）和 **estination**（GitHub 上的组织）具有足够的访问权限。 完成本文中的步骤后，你的访问和权限将为迁移准备就绪。\n\n## 确定谁将执行迁移\n\n如果执行迁移的人员**不是**GitHub组织所有者，GitHub则组织所有者必须首先向他们授予迁移者角色。\n\n* 如果你是 GitHub 组织所有者，并且打算自己执行迁移，可以继续阅读本指南。\n* 如果要将迁移者角色分配给其他人，请立即执行此作。 然后，迁移工具应执行这些指南中的其余步骤。 请参阅“[授予迁移者角色](/zh/migrations/ado/granting-the-migrator-role)”。\n\n## 在 personal access token (classic) 上创建 GitHub\n\n接下来，您需要创建一个personal access token (classic)，ADO2GH extension of the GitHub CLI将使用它与GitHub进行通信。 所需的范围 GitHubpersonal access token (classic) 取决于你的角色和要完成的任务。\n\n> \\[!NOTE]\n> 只能使用 personal access token (classic)，而不能使用 fine-grained personal access token。这意味着，如果组织使用“限制GitHub Enterprise Importer访问组织”策略，则无法使用personal access tokens (classic)。 有关详细信息，请参阅“[在企业中强制实施个人访问令牌策略](/zh/enterprise-cloud@latest/admin/enforcing-policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-personal-access-tokens-in-your-enterprise#restricting-access-by-personal-access-tokens)”。\n\n| 任务                            | 组织所有者                                                                                                                                                                                                                                | 迁移者                                                                                                                                                                                                                                  |\n| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| 为存储库迁移分配迁移者角色                 | `admin:org`                                                                                                                                                                                                                          | <svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-dash\" aria-label=\"Not applicable\" role=\"img\"><path d=\"M2 7.75A.75.75 0 0 1 2.75 7h10a.75.75 0 0 1 0 1.5h-10A.75.75 0 0 1 2 7.75Z\"></path></svg> |\n| 运行存储库迁移（目标组织）                 |                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                      |\n| `repo`、`workflow`、`admin:org` |                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                      |\n| `repo`、`workflow`、`read:org`  |                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                      |\n| 下载迁移日志                        |                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                      |\n| `repo`、`workflow`、`admin:org` |                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                      |\n| `repo`、`workflow`、`read:org`  |                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                      |\n| 回收模型                          |                                                                                                                                                                                                                                      |                                                                                                                                                                                                                                      |\n| `repo`、`workflow`、`admin:org` | <svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-dash\" aria-label=\"Not applicable\" role=\"img\"><path d=\"M2 7.75A.75.75 0 0 1 2.75 7h10a.75.75 0 0 1 0 1.5h-10A.75.75 0 0 1 2 7.75Z\"></path></svg> |                                                                                                                                                                                                                                      |\n\n若要了解如何创建令牌，请参阅 [管理个人访问令牌](/zh/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic)。\n\n## 在 Azure 上创建 Personal access token\n\nAzure DevOps personal access token必须具有 `work item (read)`、`code (read)` 和 `identity (read)` 范围。\n\n建议你授予对 personal access token 的完全访问权限，以便你能够在阶段 4 中使用 `inventory-report` 标志。\n\n如果要从多个组织迁移，请允许 personal access token 访问所有可访问的组织。\n\n请参阅 Microsoft Docs 中的 [personal access token用法](https://docs.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops\\&tabs=preview-page#create-a-pat)。\n\n## 在 GitHub 上配置 IP 允许列表\n\n如果使用 GitHubIP 允许列表功能，则必须将 GitHub 下面的 IP 范围添加到源和/或目标组织的允许列表。\n\n如果目标组织在 GitHub.com 上，则需要允许以下 IP 地址：\n\n* 192.30.252.0/22\n* 185.199.108.0/22\n* 140.82.112.0/20\n* 143.55.64.0/20\n* 135.234.59.224/28 （2025 年 7 月 28 日添加）\n* 2a0a:a440::/29\n* 2606:50c0::/32\n* 20.99.172.64/28（2025 年 7 月 28 日添加）\n\n请参阅 [管理组织允许的 IP 地址](/zh/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization) 和 [使用 IP 允许列表限制企业网络的流入流量](/zh/enterprise-cloud@latest/admin/configuring-settings/hardening-security-for-your-enterprise/restricting-network-traffic-to-your-enterprise-with-an-ip-allow-list)。\n\n## 临时配置你的身份提供商 (IdP) 限制\n\n如果使用 IdP 的 IP 允许列表（如 Azure CAP）在 GitHub 上限制对企业的访问，则应在完成迁移之前在企业帐户设置中禁用这些限制。\n\n## 允许迁移绕过存储库规则集\n\n如果目标组织或企业启用了规则集，则迁移的存储库历史记录可能会违反这些规则。 要在不禁用规则集的情况下允许迁移，请将“存储库迁移”添加到每个适用规则集的绕过列表中。  此绕过仅在迁移期间适用。 完成后，将对所有新贡献强制实施规则集。\n\n若要配置旁路，请执行以下配置：\n\n1. 导航到每个企业或组织规则集。\n2. 在“绕过列表”部分中，单击“ **添加绕过**”。\n3. 选择 **存储库迁移**。\n\n有关详细信息，请参阅 [创建组织中存储库的规则集](/zh/organizations/managing-organization-settings/creating-rulesets-for-repositories-in-your-organization) 和 [为存储库迁移设置规则集旁路](/zh/enterprise-cloud@latest/migrations/troubleshooting/setting-ruleset-bypasses-for-repository-migrations)。"}