Skip to main content

Some languages were not analyzed with CodeQL advanced setup

If some languages were not analyzed, you can modify your code scanning workflow to add a matrix specifying the languages you want to analyze.

メモ

この記事では、このバージョンの GitHub Enterprise Server の初期リリースに含まれる CodeQL アクションのバージョンおよび関連する CodeQL CLI バンドルで使用できる機能について説明します。 エンタープライズでより新しいバージョンの 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 コード スキャン用の高度なセットアップのカスタマイズ.