Deployment and dev setup · Skill

Set up GitHub secret scanning

set-up-github-secret-scanning

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.

Works with: Any AI Not yet model-tested; testing Jan 2027

Paste it into ChatGPT, Claude, Gemini or any AI chat, then tell it about your project. How it works

Install in Claude Code, Cursor or Codex (optional)

Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.

Claude Code (all your projects)

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 (this project)

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'

Codex and other Agent Skills tools (this project)

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'

Or connect the whole library over MCP

Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):

{
  "mcpServers": {
    "theskillvault": {
      "url": "https://theskillvault.ai/mcp"
    }
  }
}

GitHub 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.

When to use

  • You want secret scanning and push protection on a GitHub repository.
  • A push was rejected because it contained a credential.
  • A secret scanning alert says a token has leaked.

When not to use

  • You need a local env file and host settings. Use set-up-env-variables-and-secrets.
  • You want a pre-commit hook on a laptop. Use set-up-git-guardrails-and-pre-commit.
  • You are reviewing Actions workflow files. Use review-github-actions-security.

Steps

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. Rotate the credential at the provider even when the push never landed. The secret was on a machine and may sit in a log.
  6. Triage each alert on the Security tab. Rotate, then dismiss only with a reason: false positive, already revoked, or used only in tests.
  7. Partner alerts go to the token provider. You may not see them on the repository. Rotate anyway if the provider writes to you.
  8. 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.
paths-ignore:
  - "test/fixtures/**"
  - "**/*.example"
  1. 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.

Gotchas

  • Bypassing push protection still opens an alert. Do that only for a documented false positive. Removing the secret is the normal path.
  • A broad ignore path turns the scanner off for that tree. It is not a place to hide a real key.
  • Deleting a file later does not un-leak a secret that was pushed. Rotate first. Rewriting history does not replace rotation.
  • Do not assume a private personal repository has the same switch as a public one.
  • Never paste a live token into an issue, a chat, or the alert comment.

Portability

This 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.

Done when

  • Secret scanning and push protection are on, or you recorded that the plan does not include them.
  • A push that contains a fake credential is blocked, or each open alert has an owner.
  • Every active alert has been rotated at the provider.
  • No real credential sits in the ignore file or in the commit you just pushed.

Example prompt

"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."

---

Adapted from "secret-scanning" in github/awesome-copilot (MIT, Copyright GitHub, Inc.). See LICENSE.txt.

Bundled files

Licence

Adapted from GitHub awesome-copilot contributors (secret-scanning) (Copyright GitHub, Inc.), MIT License. Adapted by TheSkillVault: rewritten as a setup for secret scanning, push protection and alert triage; dropped the Copilot plugin, MCP pre-commit tool and custom-pattern catalogue; kept rotate-first and a short ignore-file warning. Queue name enable-github-secret-scanning; enable is not a house verb.

Licence: MIT License. Attribution when you reuse it: 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