关于启用推送保护
要为仓库启用推送保护,必须首先启用 Secret Protection。 然后,可以按照本文中所述的步骤在仓库的“Advanced Security”设置页中启用推送保护。
如果你是组织所有者,可以使用 security configurations 同时为多个存储库启用推送保护。 有关详细信息,请参阅“关于批量启用安全功能”。
组织所有者、安全管理员和存储库管理员还可以通过 API 为 secret scanning 启用推送保护。 有关详细信息,请参阅 存储库的 REST API 终结点 并展开“security_and_analysis 对象的属性”部分。
如果你的组织归企业帐户所有,企业所有者也可以在企业级别启用推送保护。 有关详细信息,请参阅“为企业创建自定义安全配置”。
为存储库启用推送保护
-
在 GitHub 上,导航到存储库的主页面。
-
在仓库名称下,单击 “Settings”****。 如果看不到“设置”选项卡,请选择“”下拉菜单,然后单击“设置”。

-
在边栏的“Security”部分中,单击“ Advanced Security”****。
-
在“Secret Protection”下的“Push Protection”右侧,单击“Enable”****。
延伸阅读
-
[AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection) -
[AUTOTITLE](/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/excluding-folders-and-files-from-secret-scanning) -
[AUTOTITLE](/get-started/learning-about-github/about-github-advanced-security)