codeql
यह क्या करती है
यह tool आपको CodeQL सेट करने और इस्तेमाल करने में मदद करता है, ताकि आप अपने code में security समस्याएँ जाँच सकें। इसे GitHub Actions के साथ या सीधे अपने computer पर इस्तेमाल किया जा सकता है।
कब इस्तेमाल करें
- ✓जब आप GitHub पर अपने code के लिए security analysis सेट करना चाहते हैं।
- ✓जब आपको CodeQL configuration file बनानी या बदलनी हो।
- ✓जब आप अपने computer पर CodeQL चलाकर code जाँचना चाहते हैं।
Skill का लिंक
https://github.com/github/awesome-copilot/blob/main/skills/codeql/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मैं अपने Python project के लिए GitHub Actions में CodeQL कैसे सेट करूँ?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
CodeQL आपके code का एक 'database' बनाता है और फिर security rules के एक सेट से उसका विश्लेषण करता है। यह GitHub Actions से अपने आप हो सकता है या command line से हाथ से।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
CodeQL Code Scanning
This skill provides procedural guidance for configuring and running CodeQL code scanning — both through GitHub Actions workflows and the standalone CodeQL CLI.
When to Use This Skill
Use this skill when the request involves:
- Creating or customizing a
codeql.ymlGitHub Actions workflow - Choosing between default setup and advanced setup for code scanning
- Configuring CodeQL language matrix, build modes, or query suites
- Running CodeQL CLI locally (
codeql database create,database analyze,github upload-results) - Understanding or interpreting SARIF output from CodeQL
- Troubleshooting CodeQL analysis failures (build modes, compiled languages, runner requirements)
- Setting up CodeQL for monorepos with per-component scanning
- Configuring dependency caching, custom query packs, or model packs
Supported Languages
CodeQL supports the following language identifiers:
| Language | Identifier | Alternatives |
|---|---|---|
| C/C++ | c-cpp |
c, cpp |
| C# | csharp |
— |
| Go | go |
— |
| Java/Kotlin | java-kotlin |
java, kotlin |
| JavaScript/TypeScript | javascript-typescript |
javascript, typescript |
| Python | python |
— |
| Ruby | ruby |
— |
| Rust | rust |
— |
| Swift | swift |
— |
| GitHub Actions | actions |
— |
Alternative identifiers are equivalent to the standard identifier (e.g.,
javascriptdoes not exclude TypeScript analysis).
Core Workflow — GitHub Actions
Step 1: Choose Setup Type
- Default setup — Enable from repository Settings → Advanced Security → CodeQL analysis. Best for getting started quickly. Uses
nonebuild mode for most languages. - Advanced setup — Create a
.github/workflows/codeql.ymlfile for full control over triggers, build modes, query suites, and matrix strategies.
To switch from default to advanced: disable default setup first, then commit the workflow file.
Step 2: Configure Workflow Triggers
Define when scanning runs:
on:
push:
branches: [main, protected]
pull_request:
branches: [main]
schedule:
- cron: '30 6 * * 1' # Weekly Monday 6:30 UTC
push— scans on every push to specified branches; results appear in Security tabpull_request— scans PR merge commits; results appear as PR check annotationsschedule— periodic scans of the default branch (cron must exist on default branch)merge_group— add if repository uses merge queues
To skip scans for documentation-only PRs:
on:
pull_request:
paths-ignore:
- '**/*.md'
- '**/*.txt'
paths-ignorecontrols whether the workflow runs, not which files are analyzed.
Step 3: Configure Permissions
Set least-privilege permissions:
permissions:
security-events: write # Required to upload SARIF results
contents: read # Required to checkout code
actions: read # Required for private repos using codeql-action
Step 4: Configure Language Matrix
Use a matrix strategy to analyze each language in parallel:
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
For compiled languages, set the appropriate build-mode:
none— no build required (supported for C/C++, C#, Java, Rust)autobuild— automatic build detectionmanual— custom build commands (advanced setup only)
For detailed per-language autobuild behavior and runner requirements, search
references/compiled-languages.md.
Step 5: Configure CodeQL Init and Analysis
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended
dependency-caching: true
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"
Query suite options:
security-extended— default security queries plus additional coveragesecurity-and-quality— security plus code quality queries- Custom query packs via
packs:input (e.g.,codeql/javascript-queries:AlertSuppression.ql)
…
अक्सर पूछे जाने वाले सवाल
CodeQL क्या है?
CodeQL एक tool है जो आपके code को data में बदल देता है, ताकि उसका security vulnerabilities और bugs के लिए विश्लेषण किया जा सके।
GitHub Actions क्या है?
GitHub Actions एक सेवा है जिससे आप GitHub के अंदर काम अपने आप चला सकते हैं, जैसे tests चलाना या code जाँचना, सीधे आपके repository से।
SARIF क्या है?
SARIF security विश्लेषण के नतीजों को रिपोर्ट करने का एक standard format है, जिसे CodeQL मिले issues दिखाने के लिए इस्तेमाल करता है।
जानकारी
लेखक का मूल विवरण
Comprehensive guide for setting up and configuring CodeQL code scanning via GitHub Actions workflows and the CodeQL CLI. This skill should be used when users need help with code scanning configuration, CodeQL workflow files, CodeQL CLI commands, SARIF output, security analysis setup, or troubleshooting CodeQL analysis.
repo: github/awesome-copilot
लोकप्रियता
- GitHub स्टार
- 40k
- रैंकिंग में स्थान
- #7112
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
acquire-codebase-knowledge
40kआपके एजेंट को किसी मौजूदा code प्रोजेक्ट को समझने और उसका documentation बनाने में मदद करता है। यह नए लोगों को प्रोजेक्ट से जोड़ने या architecture का सार जानने में उपयोगी है।
acreadiness-assess
40kआपके एजेंट को किसी प्रोजेक्ट की AI के लिए तैयारी जाँचने और रिपोर्ट बनाने देता है। यह समझने में उपयोगी है कि प्रोजेक्ट AI tools इस्तेमाल करने के लिए कितना तैयार है।
acreadiness-generate-instructions
40kआपके एजेंट को assessment के आधार पर AI tools के लिए निर्देश बनाने में मदद करता है। यह बताता है कि AI कोड के साथ बेहतर कैसे काम करे और पहचानी गई कमियाँ कैसे दूर हों।
acreadiness-policy
40kआपके एजेंट को AI प्रोजेक्ट assessment के लिए नीतियाँ तय करने या लागू करने में मदद करता है। यह प्रोजेक्ट्स के मूल्यांकन को मानक बनाने और compliance सुनिश्चित करने में उपयोगी है।
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।