GitHub code scanning
Finding insecure patterns in a repository's code with CodeQL, especially on a public GitHub repo.
Last updated
- Price
- Free for public repos
- Free tier
- Yes
- Checks
- Source
- Last verified
- Oct 21, 2026
What the public pages say
What is GitHub code scanning, and is it free?
Code scanning analyzes the code in a GitHub repository to find security vulnerabilities and coding errors, using GitHub's CodeQL or a third-party tool that outputs SARIF. It is free on public repositories on GitHub.com. Private repositories need GitHub Code Security. GitHub Dependabot is separate: it alerts on dependencies known to contain security vulnerabilities, and GitHub lists it as available on all plans, while code scanning analyzes your own code.
GitHub lists code scanning for public repositories, and for organization-owned repositories on GitHub Team, GitHub Enterprise Cloud, or GitHub Enterprise Server with GitHub Code Security enabled. Code Security can only be bought on a GitHub Team or GitHub Enterprise plan. Code scanning runs on GitHub Actions, and each workflow run uses Actions minutes.
For a private repository, budget for GitHub Code Security or use a scanner with a free private tier, and check that product's current plan.
How do I turn on GitHub code scanning?
Start with default setup. GitHub's setup guide says a repository is eligible when GitHub Actions is enabled and the repository is public or has GitHub Code Security enabled.
- On the repository's main page, click Settings.
- In the "Security and quality" section of the sidebar, click Advanced Security.
- Under "Code Security", to the right of "CodeQL analysis", select Set up, then click Default.
- Review the configuration, then click Enable CodeQL.
GitHub's setup types page says default setup scans when you enable it, on each push to the default branch or any protected branch, on pull requests against those branches (excluding pull requests from forks), and weekly if a push or pull request has triggered a scan in the last 180 days.
Advanced setup is your own GitHub Actions workflow, for example to build compiled languages, use a matrix build, or change the analysis schedule. GitHub says to use it when default setup's customization options, including a custom configuration file, don't meet your needs.
Once alerts show up, see How do I fix GitHub code scanning alerts?.
What does GitHub code scanning miss?
Code scanning looks at code paths. It will not see a Supabase policy that lives only in the dashboard and was never committed. Check those with the Supabase Security Advisor or the SQL in How to check if RLS is enabled on every Supabase table.
Our advice: also review agents in workflows that read issues, comments, or emails and then act. See AI agents in your workflows.
Free tier
GitHub's security features page says code scanning and the CodeQL CLI are available for public repositories by default. Private repositories need GitHub Code Security. Copilot Autofix for code scanning alerts is also listed as available for public repositories by default.
Left off the vendor's site
- Language coverage and which queries run by default. Read the current code scanning docs for the language list.
Sources
- https://docs.github.com/en/code-security/getting-started/github-security-features
- https://docs.github.com/en/code-security/concepts/code-scanning/code-scanning
- https://docs.github.com/en/code-security/how-tos/find-and-fix-code-vulnerabilities/configure-code-scanning/configure-code-scanning
- https://docs.github.com/en/code-security/concepts/code-scanning/setup-types
- https://docs.github.com/en/get-started/learning-about-github/about-github-advanced-security
Is this your tool?
Something out of date? Email team@shipsecurely.dev with the page that shows the change. Corrections are free.
Want it pinned to the top of its category? Featured is $49/month, labeled Featured, and it never changes comparison order.