codeql

Configure CodeQL workflows and CLI runs to generate and upload SARIF findings.

3|1|Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill codeql-cogni-ai-ou
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codeql
Source: https://github.com/Cogni-AI-OU/cogni-ai-agent-skills/tree/main/codeql
Command: npx skills add https://github.com/Cogni-AI-OU/cogni-ai-agent-skills --skill codeql-cogni-ai-ou

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you reliably configure and execute CodeQL code scanning so you can find security issues early, consistently upload SARIF results, and avoid common failures during setup and analysis.

Core Features & Use Cases

  • GitHub Actions workflow setup: Configure CodeQL analysis in a workflow such as .github/workflows/codeql.yml with correct permissions and triggers.
  • CLI-based database build and analysis: Create CodeQL databases, run queries, and upload or review SARIF outputs using the CodeQL CLI.
  • Troubleshooting and hardening: Address typical pitfalls like autobuild failures, missing security-events permissions, and runner disk exhaustion.

Use case example: when a repository’s languages include both JavaScript/TypeScript and a compiled language, you configure a language matrix with the right build-mode and run analysis that uploads standardized SARIF for each component.

Quick Start

Use the codeql skill to set up and run CodeQL analysis in your GitHub repository by following the advanced workflow pattern for your target language matrix and uploading SARIF results.

Frequently Asked Questions about codeql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure CodeQL code scanning in GitHub Actions to upload SARIF results?

To configure CodeQL code scanning in GitHub Actions, you must grant `security-events: write` permissions to your workflow token and use the `github/codeql-action/init@v4` and `analyze@v4` actions to initialize and analyze your code, ultimately uploading the generated SARIF file.

Why does my CodeQL autobuild fail for compiled languages in a matrix workflow?

CodeQL autobuild failures for compiled languages often stem from missing build tools or incorrect environment setup. You can resolve this by selecting the appropriate build-mode (none, autobuild, or manual) in your workflow configuration and troubleshooting resource-limitation issues like runner disk exhaustion.

Can I run CodeQL SAST analysis locally using the CLI instead of GitHub Actions?

Yes, you can run CodeQL SAST analysis locally using the CodeQL CLI. You need to manually create a CodeQL database for your target language, execute the analysis queries, and then review or upload the resulting SARIF security findings output.

What's the best way to run CodeQL security scanning for a repository with both JavaScript and compiled languages?

The best way to run CodeQL security scanning for mixed-language repositories is to configure a language matrix in your GitHub Actions workflow. This allows you to select the appropriate build-mode for each language component and upload standardized SARIF results individually.

Do I need specific permissions to generate and upload SARIF security findings from CodeQL?

Yes, generating and uploading SARIF security findings requires the `security-events: write` permission in your GitHub Actions workflow configuration. Without this explicit permission, the CodeQL analysis action cannot successfully upload the security scanning results to your repository.

How does CodeQL database build and analysis work for troubleshooting code scanning workflows?

CodeQL database build and analysis works by extracting a relational representation of your codebase, allowing queries to identify security issues. When troubleshooting workflow failures, you can manually adjust the build-mode or use the CLI to isolate resource-limitation and autobuild issues.