मुख्य सामग्री पर जाएँ
Skillpedia
टेस्टिंग40k · #7112

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 पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/github/awesome-copilot/blob/main/skills/codeql/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

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.yml GitHub 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., javascript does 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 none build mode for most languages.
  • Advanced setup — Create a .github/workflows/codeql.yml file 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 tab
  • pull_request — scans PR merge commits; results appear as PR check annotations
  • schedule — 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-ignore controls 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 detection
  • manual — 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 coverage
  • security-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

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस 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 सुनिश्चित करने में उपयोगी है।

AI और एजेंटएजेंट

मिलती-जुलती skills