{"name":"set-up-github-secret-scanning","description":"Turns on GitHub secret scanning, push protection and leaked-secret alerts so a credential is caught before the repository stores it. Use when the user wants GitHub secret scanning, a push blocked by push protection, or to triage a leaked-secret alert.","category":"deployment","tags":["github","security"],"models":["any"],"proven":false,"passing_families":0,"model_testing":"Not yet model-tested; testing Jan 2027","url":"https://theskillvault.ai/skills/set-up-github-secret-scanning","api_url":"https://theskillvault.ai/api/skills/set-up-github-secret-scanning","raw_url":"https://theskillvault.ai/api/skills/set-up-github-secret-scanning/raw","body":"# Set up GitHub secret scanning\n\nGitHub can spot a credential in a repository and block a push that contains one. This skill turns that on and says what to do with an alert. Day-to-day key storage is a different skill.\n\n## When to use\n- You want secret scanning and push protection on a GitHub repository.\n- A push was rejected because it contained a credential.\n- A secret scanning alert says a token has leaked.\n\n## When not to use\n- You need a local env file and host settings. Use set-up-env-variables-and-secrets.\n- You want a pre-commit hook on a laptop. Use set-up-git-guardrails-and-pre-commit.\n- You are reviewing Actions workflow files. Use review-github-actions-security.\n\n## Steps\n1. Open the repository settings, then Advanced Security. Enable Secret Protection. Secret scanning is already on for a public repository. A private repository needs GitHub Secret Protection on a plan that includes it.\n2. Turn on push protection in that same section. It can block a secret in a command-line push, a web commit, a file upload and an API write.\n3. Turn on validity checks when the plan offers them. Active means the credential still works. Rotate that one first. Inactive can wait. Unknown means GitHub could not tell.\n4. If a push is blocked, take the secret out of the commit and push again. For the latest commit, amend once the file is clean. Do not force-push a branch other people use.\n5. Rotate the credential at the provider even when the push never landed. The secret was on a machine and may sit in a log.\n6. Triage each alert on the Security tab. Rotate, then dismiss only with a reason: false positive, already revoked, or used only in tests.\n7. Partner alerts go to the token provider. You may not see them on the repository. Rotate anyway if the provider writes to you.\n8. Add `.github/secret_scanning.yml` only to skip fixture paths that hold fakes. Those paths also skip push protection. Review the list on a schedule.\n\n```yaml\npaths-ignore:\n  - \"test/fixtures/**\"\n  - \"**/*.example\"\n```\n\n9. Add a custom pattern only for a shape GitHub does not already detect. Dry-run it, read the hits, then publish. You can turn push protection on for that pattern too.\n\n## Gotchas\n- Bypassing push protection still opens an alert. Do that only for a documented false positive. Removing the secret is the normal path.\n- A broad ignore path turns the scanner off for that tree. It is not a place to hide a real key.\n- Deleting a file later does not un-leak a secret that was pushed. Rotate first. Rewriting history does not replace rotation.\n- Do not assume a private personal repository has the same switch as a public one.\n- Never paste a live token into an issue, a chat, or the alert comment.\n\n## Portability\nThis switch is GitHub's. If you use GitLab or another host, turn on that host's secret detection and push blocking. A local scanner such as gitleaks is the equivalent check before a commit. Rotate-first applies on any host.\n\n## Done when\n- Secret scanning and push protection are on, or you recorded that the plan does not include them.\n- A push that contains a fake credential is blocked, or each open alert has an owner.\n- Every active alert has been rotated at the provider.\n- No real credential sits in the ignore file or in the commit you just pushed.\n\n## Example prompt\n\"Turn on GitHub secret scanning and push protection. A push was blocked for a leaked token. Tell me how to clear it and how to triage the alert.\"\n\n---\nAdapted from \"secret-scanning\" in github/awesome-copilot (MIT, Copyright GitHub, Inc.). See LICENSE.txt.","files":["LICENSE.txt"],"license":"MIT","license_name":"MIT License","license_url":"https://opensource.org/license/mit","attribution":"Based on work by GitHub awesome-copilot contributors (secret-scanning) (Copyright GitHub, Inc., MIT License), https://github.com/github/awesome-copilot/tree/5269f7ea2d6c3a9bfda5ed878b6726cf509121fd/skills/secret-scanning; adapted by TheSkillVault, https://theskillvault.ai","install":{"claude_code":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/set-up-github-secret-scanning/raw' -o ~/'.claude/skills/set-up-github-secret-scanning/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/set-up-github-secret-scanning/files/LICENSE.txt' -o ~/'.claude/skills/set-up-github-secret-scanning/LICENSE.txt'","cursor":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/set-up-github-secret-scanning/raw' -o '.cursor/skills/set-up-github-secret-scanning/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/set-up-github-secret-scanning/files/LICENSE.txt' -o '.cursor/skills/set-up-github-secret-scanning/LICENSE.txt'","agents":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/set-up-github-secret-scanning/raw' -o '.agents/skills/set-up-github-secret-scanning/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/set-up-github-secret-scanning/files/LICENSE.txt' -o '.agents/skills/set-up-github-secret-scanning/LICENSE.txt'","mcp_url":"https://theskillvault.ai/mcp","cursor_mcp_deeplink":"cursor://anysphere.cursor-deeplink/mcp/install?name=theskillvault&config=eyJ1cmwiOiJodHRwczovL3RoZXNraWxsdmF1bHQuYWkvbWNwIn0%3D","mcp_config":{"mcpServers":{"theskillvault":{"url":"https://theskillvault.ai/mcp"}}}},"bundles":[],"tested_on":[{"family":"chatgpt","name":"ChatGPT","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"claude","name":"Claude","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"gemini","name":"Gemini","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"grok","name":"Grok","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"llama","name":"Llama","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"deepseek","name":"DeepSeek","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"mistral","name":"Mistral","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"qwen","name":"Qwen","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"kimi","name":"Kimi K","outcome":null,"date":null,"source":null,"counts":false,"stale":false}],"proven_rule":{"threshold":5,"window_days":365,"computed_at":"2026-11-29T03:42:30.374Z"}}