Skip to main content

为存储库启用推送保护

通过推送保护,secret scanning 会阻止参与者将机密推送到存储库,并在参与者绕过该保护时生成警报。

谁可以使用此功能?

具有管理员角色的存储库所有者、组织所有者、安全管理员和用户

  1. On GitHub, navigate to the main page of the repository.

  2. Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.

    Screenshot of a repository header showing the tabs. The "Settings" tab is highlighted by a dark orange outline.

  3. In the "Security" section of the sidebar, click Code security.

  1. Under "Code security", find "GitHub Advanced Security."
  2. Under "Secret scanning", under "Push protection", click Enable.

Further reading