Files
locadex-agent[bot] ff9f428146 docs(locadex): update translations (#1783)
Co-authored-by: locadex-agent[bot] <217277504+locadex-agent[bot]@users.noreply.github.com>
2025-11-14 15:50:52 -08:00

115 lines
4.8 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "GitHub"
description: "连接 GitHub 存储库,以启用自动部署、拉取请求(PR;亦称“合并请求”/Merge Request)预览和持续同步。"
keywords: ["GitHub App", "repository connection", "automated deployments"]
---
Mintlify 使用 GitHub 应用,将你的文档与 GitHub 存储库自动同步。
<div id="installing-the-github-app">
## 安装 GitHub 应用
</div>
<Note>
你必须在存储库中拥有组织所有者或管理员权限才能安装该应用。如果你没有相应权限,需要由存储库所有者批准安装请求。
</Note>
通过你的[控制台](https://dashboard.mintlify.com/settings/organization/github-app)安装 Mintlify GitHub 应用。
<Tip>
我们建议只为托管你文档的存储库授予访问权限。
</Tip>
<Frame>
<img className="h-80" alt="Mintlify GitHub 应用安装页面,已选择“Only select repositories”选项。" src="/images/github/select-repos.png" />
</Frame>
<div id="permissions">
## 权限
</div>
安装 GitHub 应用时,你会被提示授予以下权限:
读取权限:
* `metadata`:基本存储库信息
读取和写入权限:
* `checks`:在拉取请求(PR)上创建状态检查
* `code`:当你向文档 branch 提交时读取文件更改
* `deployments`:为拉取请求(PR)生成预览部署
* `pull requests`:通过网页版编辑器创建 branch 和拉取请求(PR)
<Info>
该应用仅会访问你明确授予其访问权限的存储库。若启用了 branch 保护规则,该应用无法直接推送到受保护的 branch。
</Info>
<div id="managing-repository-access">
## 管理存储库访问
</div>
安装我们的 GitHub 应用时,你可以授予对所有或特定存储库的访问权限。我们建议仅为存放文档的存储库授予访问权限。你可以随时在 [GitHub 应用设置](https://github.com/apps/mintlify/installations/new) 中修改此选择。
<div id="configuring-docs-source">
## 配置文档来源
</div>
在控制台的 [Git Settings](https://dashboard.mintlify.com/settings/deployment/git-settings) 部分,您可以更改用于构建文档的组织、存储库或 branch。
<div id="github-enterprise-with-ip-allowlists">
## 启用 IP 允许列表的 GitHub Enterprise
</div>
如果你的 GitHub Enterprise Cloud 组织启用了 IP 允许列表,你需要将 Mintlify 的出口 IP 地址(`54.242.90.151`)添加到允许列表中,才能确保 GitHub 应用正常运行。
请按照 [GitHub 的文档](https://docs.github.com/en/enterprise-cloud@latest/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-allowed-ip-addresses-for-your-organization) 配置 IP 允许列表。
<div id="troubleshooting">
## 故障排查
</div>
<div id="github-app-connection-issues">
### GitHub 应用连接问题
</div>
如果你遇到 GitHub 应用相关问题,重置连接通常可以解决大多数情况。
<Steps>
<Step title="通过 GitHub 卸载 Mintlify 应用">
1. 在 GitHub 中,前往 [installations](https://github.com/settings/installations),在 Mintlify 应用旁点击 **Configure**。向下滚动并选择 **Uninstall**。
2. 前往 [Authorized GitHub Apps](https://github.com/settings/apps/authorizations),在 Mintlify 应用旁选择 **Revoke**。
</Step>
<Step title="重新安装 Mintlify 应用">
1. 在你的 Mintlify 控制台中,前往 [Git Settings](https://dashboard.mintlify.com/settings/deployment/git-settings) 并安装 GitHub 应用。
2. 在控制台的 [My Profile](https://dashboard.mintlify.com/settings/account) 中授权你的账户。
</Step>
</Steps>
<div id="feedback-add-ons-are-unavailable">
### 反馈附加组件不可用
</div>
如果你无法在控制台中启用“编辑建议”或“提交问题”选项,并且你的存储库为公开状态,请重新验证你的 Git 设置。
<Steps>
<Step title="Navigate to Git Settings">
前往控制台中的 [Git Settings](https://dashboard.mintlify.com/settings/deployment/git-settings)。
</Step>
<Step title="Revalidate your settings">
点击 Git 设置卡片右上角的绿色勾选图标以重新验证存储库设置。此操作会强制更新设置,以准确反映你的存储库是公开还是私有。
<Frame>
<img
src="/images/github/revalidate-settings-light.png"
alt="Mintlify 控制台中的 Git Settings 页面。橙色箭头指向用于重新验证存储库设置的绿色勾选图标。"
className="block dark:hidden"
/>
<img
src="/images/github/revalidate-settings-dark.png"
alt="Mintlify 控制台中的 Git Settings 页面。橙色箭头指向用于重新验证存储库设置的绿色勾选图标。"
className="hidden dark:block"
/>
</Frame>
</Step>
</Steps>