理解为什么推送保护阻止了你的提交
泄露的机密可能会对仓库和供应链构成严重的安全风险。 推送保护可防止你意外将机密引入代码库,从而避免恶意行为者利用这些机密。
如果你在 GitHub 上参与贡献的存储库启用了推送保护,则在以下情况下会遇到推送保护阻止:
-
将包含已识别机密的提交**从命令行****推送**到远程存储库。 - 提交更改或将包含已识别机密的文件上传到 GitHub UI 中的仓库。********
-
在 **REST API** 中发出包含已识别机密的**某些请求**。
解决推送保护阻止
要解决该阻止,应从提交 (或请求) 中移除机密。 如果你认为推送机密是安全的,则也许能够绕过阻止。 有关如何删除机密或者, 如有必要, 绕过阻止的详细信息, 请参阅:
-
[AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-from-the-command-line) -
[AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-in-the-github-ui) -
[AUTOTITLE](/code-security/secret-scanning/working-with-secret-scanning-and-push-protection/working-with-push-protection-from-the-rest-api)
其他阅读材料
-
[AUTOTITLE](/code-security/secret-scanning/introduction/about-push-protection) -
[AUTOTITLE](/code-security/secret-scanning/introduction/supported-secret-scanning-patterns)