Примечание.
В этой статье описываются функции, доступные в версии действия CodeQL и связанного пакета CodeQL CLI в первоначальном выпуске этой версии GitHub Enterprise Server. Если ваше предприятие использует более последнюю версию действия CodeQL, ознакомьтесь с версией GitHub Enterprise Cloud этой статьи, чтобы узнать о последних функциях. Сведения об использовании последней версии см. в разделе Настройка сканирования кода для устройства.
If you're using advanced setup and your workflow doesn't explicitly specify the languages to analyze, CodeQL implicitly detects the supported languages in your code base. In this configuration, out of the compiled languages C/C++, C#, Go, Java, Kotlin, Rust (общедоступная предварительная версия), и Swift, CodeQL only analyzes the language with the most source files. Edit the workflow and add a matrix specifying the languages you want to analyze. The default CodeQL analysis workflow uses such a matrix.
The following extracts from a workflow show how you can use a matrix within the job strategy to specify languages, and then reference each language within the "Initialize CodeQL" step:
jobs:
analyze:
permissions:
security-events: write
actions: read
# ...
strategy:
fail-fast: false
matrix:
language: ['csharp', 'c-cpp', 'javascript-typescript']
steps:
# ...
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
For more information about editing the workflow, see Настройка расширенной настройки для сканирования кода.