diff --git a/.codeql-config.yml b/.codeql-config.yml new file mode 100644 index 0000000000..82f91d0bbc --- /dev/null +++ b/.codeql-config.yml @@ -0,0 +1,6 @@ +paths: + exclude: + - "**/test/**" + - "**/__tests__/**" + - "**/*.spec.*" + - "**/*.test.*" \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 384a4f691c..3fa6c8a013 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -66,6 +66,8 @@ jobs: with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} + # Use our custom configuration file to exclude test files. + config-file: .codeql-config.yml # If you wish to specify custom queries, you can do so here or in a config file. # By default, queries listed here will override any specified in a config file. # To add queries to those specified in your config file, prefix the list here with "+" @@ -92,4 +94,4 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 with: - category: "/language:${{ matrix.language }}" + category: "/language:${{ matrix.language }}" \ No newline at end of file