理解为什么推送保护阻止了你的提交
泄露的机密可能会对仓库和供应链构成严重的安全风险。 推送保护可防止你意外将机密引入代码库,从而避免恶意行为者利用这些机密。
如果你在 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)