From 7d2d17422a9c431ba51a6c72dfe98a56349f4af7 Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Tue, 13 Aug 2024 10:08:47 +0200 Subject: [PATCH 1/3] Create codeql.yml --- .github/workflows/codeql.yml | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..2dd87f30e --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,51 @@ +name: "CodeQL" +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + schedule: + - cron: '0 22 * * SUN' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + security-events: write + packages: read + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: javascript-typescript + build-mode: none + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + config: | + paths: + - packages/*/@(bin|src|lib)/**/*.@(js|ts) + - if: matrix.build-mode == 'manual' + shell: bash + run: | + echo 'If you are using a "manual" build mode for one or more of the' \ + 'languages you are analyzing, replace this with the commands to build' \ + 'your code, for example:' + echo ' make bootstrap' + echo ' make release' + exit 1 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" From 5a60615b52ab0b64e470bd281f9e2571078dc5ab Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Tue, 13 Aug 2024 10:16:55 +0200 Subject: [PATCH 2/3] Apply suggestions from code review --- .github/workflows/codeql.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2dd87f30e..eb57389cb 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -17,7 +17,6 @@ jobs: packages: read actions: read contents: read - strategy: fail-fast: false matrix: @@ -34,16 +33,7 @@ jobs: build-mode: ${{ matrix.build-mode }} config: | paths: - - packages/*/@(bin|src|lib)/**/*.@(js|ts) - - if: matrix.build-mode == 'manual' - shell: bash - run: | - echo 'If you are using a "manual" build mode for one or more of the' \ - 'languages you are analyzing, replace this with the commands to build' \ - 'your code, for example:' - echo ' make bootstrap' - echo ' make release' - exit 1 + - 'packages/*/@(bin|src|lib)/**/*.@(js|ts)' - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 From ca9ac85ea984f470b11d57c50d96be32a5c0a4da Mon Sep 17 00:00:00 2001 From: Kamil Piechaczek Date: Tue, 13 Aug 2024 10:19:40 +0200 Subject: [PATCH 3/3] Apply suggestions from code review --- .github/workflows/codeql.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index eb57389cb..350da82e8 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -33,8 +33,11 @@ jobs: build-mode: ${{ matrix.build-mode }} config: | paths: - - 'packages/*/@(bin|src|lib)/**/*.@(js|ts)' - + - 'packages/*/bin/*.js' + - 'packages/*/src/**/*.ts' + - 'packages/*/src/**/*.js' + - 'packages/*/lib/**/*.ts' + - 'packages/*/lib/**/*.js' - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 with: