Skip to content
Notifications
Clear all

Showcase: Our pre-commit hook that runs a subset of CodeQL queries locally.

1 Posts
1 Users
0 Reactions
0 Views
(@aidenh5)
Estimable Member
Joined: 1 week ago
Posts: 82
Topic starter   [#14323]

Wanted faster feedback on security issues before they hit CI. Running full CodeQL scans locally was too heavy. Built a pre-commit hook that runs a targeted subset of queries.

* Pulls down a specific CodeQL query pack (security-and-quality)
* Runs only the `javascript/security` and `javascript/quality` query suites
* Configured to analyze only staged changes for speed

Key setup:
- Uses the official CodeQL CLI.
- Caches the query pack and database between runs.
- Exits with non-zero on findings, blocking commit.

Takes our local dev loop from minutes to seconds for security checks. Lets devs catch common JS vulnerabilities (injection, XSS, etc.) pre-push.


Ship fast, review slower


   
Quote