{"meta":{"title":"共享 GitHub 应用","intro":"可以与其他用户共享自己的 GitHub App。","product":"应用","breadcrumbs":[{"href":"/zh/enterprise-cloud@latest/apps","title":"应用"},{"href":"/zh/enterprise-cloud@latest/apps/sharing-github-apps","title":"共享 GitHub Apps"},{"href":"/zh/enterprise-cloud@latest/apps/sharing-github-apps/sharing-your-github-app","title":"共享应用"}],"documentType":"article"},"body":"# 共享 GitHub 应用\n\n可以与其他用户共享自己的 GitHub App。\n\n## 在 GitHub App 上分享您的 GitHub Marketplace\n\n如果 GitHub App 是公开的，则可以选择将其发布至 GitHub Marketplace。 有关详细信息，请参阅“[关于 GitHub 应用市场](/zh/enterprise-cloud@latest/apps/publishing-apps-to-github-marketplace/github-marketplace-overview/about-github-marketplace)”。\n\n如果你是 Enterprise Managed User，则无法在 GitHub Marketplace 上共享你的应用。\n\n若要详细了解用户如何从 GitHub Marketplace\n安装你的应用，请参阅“[通过 GitHub 市场安装 GitHub App 以用于组织](/zh/enterprise-cloud@latest/apps/using-github-apps/installing-a-github-app-from-github-marketplace-for-your-organizations)”和“[通过 GitHub 市场安装 GitHub App 以用于个人帐户](/zh/enterprise-cloud@latest/apps/using-github-apps/installing-a-github-app-from-github-marketplace-for-your-personal-account)”。\n\n## 通过安装链接共享 GitHub App\n\n如果 GitHub App 是公开的，则其他用户和组织可以安装该应用。 若要详细了解如何公开应用，请参阅“[将GitHub应用公开或专用](/zh/enterprise-cloud@latest/apps/creating-github-apps/setting-up-a-github-app/making-a-github-app-public-or-private)”。\n\n如果你是 Enterprise Managed User 或应用由你的企业帐户拥有，则你只能与企业内的帐户共享应用。\n\n1. 在 GitHub 上任意页的右上角，单击你的个人资料图片。\n2. 导航到你的帐户设置。\n   * 对于由个人帐户拥有的应用，请单击“设置”\\*\\*\\*\\*。\n   * 对于组织拥有的应用：\n     1. 单击“你的组织”。\n     2. 在组织的右侧，单击**设置**。\n   * 对于由企业拥有的应用：\n     1. 如果使用的是 Enterprise Managed Users，请单击**你的企业**，以直接转到企业帐户设置。\n     2. 如果使用的是个人帐户，请单击**你的企业**，然后单击企业右侧的**设置**。\n3. 导航到 GitHub App 设置。\n   * 对于由个人帐户或组织拥有的应用：\n     1. 在左侧边栏中，单击“<svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-code\" aria-label=\"code\" role=\"img\"><path d=\"m11.28 3.22 4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L13.94 8l-3.72-3.72a.749.749 0 0 1 .326-1.275.749.749 0 0 1 .734.215Zm-6.56 0a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042L2.06 8l3.72 3.72a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L.47 8.53a.75.75 0 0 1 0-1.06Z\"></path></svg> Developer settings”，然后单击“GitHub Apps”\\*\\*\\*\\*\\*\\*\\*\\*。\n   * 对于由企业拥有的应用：\n     1. 在左侧边栏中，在“设置”下，单击 **GitHub Apps**。\n4. 在要共享的 GitHub App 旁边，单击“编辑”。\n5. 单击“公共页面”。 GitHub 会将你导航到GitHub App 的公开页面。\n6. 单击“安装” 。 GitHub 会将你导航到 GitHub App 的安装 URL。 URL 类似于 `https://github.com/apps/APP-NAME/installations/new`，其中 `APP-NAME` 是 GitHub App 的名称。\n7. 与其他用户共享安装 URL。 若要详细了解用户如何从此 URL 安装你的应用，请参阅“[从第三方途径安装 GitHub Apps](/zh/enterprise-cloud@latest/apps/using-github-apps/installing-a-github-app-from-a-third-party)”。\n\n   在共享 URL 时，你可以在安装 URL 中包含 `state` 查询参数，以保留应用程序页面的状态，并在用户安装、身份验证或接受 GitHub App 的更新后将用户返回到该状态。 例如，可使用 `state` 参数将安装关联到用户或帐户。\n\n   要保留状态，请将其添加到安装 URL：`https://github.com/apps/<app name>/installations/new?state=AB12t`\n\n## GitHub App 与 GitHub Enterprise Server 实例共享\n\n如果要与你不属于其中的 GitHub App 实例共享 GitHub Enterprise Server，则需要执行其他步骤。 有关详细信息，请参阅“[使GitHub应用可用于 GitHub Enterprise Server](/zh/enterprise-cloud@latest/apps/creating-github-apps/setting-up-a-github-app/making-your-github-app-available-for-github-enterprise-server)”。"}