-
On GitHub, navigate to the main page of the repository.
-
Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.

-
In the "Security" section of the sidebar, click Advanced Security.
-
If you have not already enabled Secret Protection, to the right of "Secret Protection", click Enable.
-
In the "Secret Protection" section, to the right of "Push protection", click Enable.
为存储库启用推送保护
通过推送保护,secret scanning 会阻止参与者将机密推送到存储库,并在参与者绕过该保护时生成警报。