Nota:
En este artículo, se describen las características disponibles con la versión de la acción CodeQL y el paquete CodeQL CLI asociado incluido en el lanzamiento inicial de esta versión de GitHub Enterprise Server. Si en la empresa se usa una versión más reciente de la acción CodeQL, consulta la versión de GitHub Enterprise Cloud de este artículo para obtener información sobre las características más recientes. Para obtener información sobre el uso de la última versión, consulta Configuración la digitalización de código para el dispositivo.
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 (versión preliminar pública), y 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 Personalización de la configuración avanzada para el examen de código.