Create codeql.yml #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CodeQL analysis | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
analyze: | |
name: Analyze code with CodeQL | |
runs-on: ubuntu-latest # or macos-latest for Swift projects | |
permissions: | |
security-events: write # Required for security event access | |
actions: read | |
contents: read | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- language: javascript-typescript # Specify languages for analysis | |
- language: python | |
- language: c-cpp | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 # Check out the repository so the workflow can access the code | |
# Set up CodeQL tools for scanning | |
- name: Set up CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: ${{ matrix.language }} # Use the languages defined in the matrix | |
build-mode: "auto" # Auto build mode for most projects | |
# Perform CodeQL analysis on the code | |
- name: Perform CodeQL analysis | |
uses: github/codeql-action/analyze@v3 | |
with: | |
category: "/language:${{ matrix.language }}" # Set category to language-specific results |