Create codeql.yml #3
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 # JavaScript/TypeScript: No special build mode required | |
build-mode: "none" | |
- language: python # Python: No build step required | |
build-mode: "none" | |
- language: c-cpp # C++: Use autobuild or manual | |
build-mode: "autobuild" # Change this if needed to "manual" for custom steps | |
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: ${{ matrix.build-mode }} # Use the build mode specified in the matrix | |
# 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 |