-
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 Code security and analysis.
- Under "Code security and analysis", find "GitHub Advanced Security."
- Under "Secret scanning", under "Push protection", click Enable.