From cbc8446e324c6e55c38d9d79d148492c5b96f4cd Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 12:54:24 +0100 Subject: [PATCH 01/10] Add CodeQL workflow --- .github/workflows/codeql.yml | 85 ++++++++++++++++++++++++++++++++++++ 1 file changed, 85 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 0000000..905b4c1 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,85 @@ + +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '30 14 * * 4' + +jobs: + analyze: + name: Analyze + runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} + timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ] + # Use only 'java' to analyze code written in Java, Kotlin or both + # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # 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. + # Prefix the list here with "+" to use these queries and those in the config file. + + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + config: | + paths-ignore: + - '**/*.test.js' + - '**/*.spec.js' + - '**/*.test.ts' + - '**/*.spec.ts' + - '**/*.test.tsx' + - '**/*.spec.tsx' + + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" From 4b8df58d500cef5f672dcc6527207d4856ed5b98 Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 13:59:32 +0100 Subject: [PATCH 02/10] Add or update CodeQL workflow From 85208f1cde704791be6ea4ecf182b04c17d63641 Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 14:21:26 +0100 Subject: [PATCH 03/10] Add or update CodeQL workflow --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 905b4c1..0e0afd1 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -34,7 +34,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'javascript' ] + language: [ 'cpp','javascript' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ] # Use only 'java' to analyze code written in Java, Kotlin or both # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both From 25394503ab4754d0ff6bab98ff06b69e58eb7d1b Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 14:33:58 +0100 Subject: [PATCH 04/10] Add or update CodeQL workflow --- .github/workflows/codeql.yml | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0e0afd1..93f123d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -34,7 +34,7 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'cpp','javascript' ] + language: [ 'cpp', 'javascript' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ] # Use only 'java' to analyze code written in Java, Kotlin or both # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both @@ -64,22 +64,19 @@ jobs: - '**/*.test.tsx' - '**/*.spec.tsx' - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 + - name: Use Node.js v18.x + if: matrix.language == 'cpp' + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 + with: + node-version: 18.x - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + - name: Build cpp + if: matrix.language == 'cpp' + run: | + npx node-gyp rebuild - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis + - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 with: category: "/language:${{matrix.language}}" From 5d875d66ef0fb5933cdeb8a2e85113d113d574e5 Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 14:57:22 +0100 Subject: [PATCH 05/10] Add or update CodeQL workflow --- .github/workflows/codeql.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 93f123d..a941bf0 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -65,18 +65,18 @@ jobs: - '**/*.spec.tsx' - name: Use Node.js v18.x - if: matrix.language == 'cpp' - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 - with: - node-version: 18.x + if: matrix.language == 'cpp' + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 + with: + node-version: 18.x - name: Build cpp - if: matrix.language == 'cpp' - run: | - npx node-gyp rebuild + if: matrix.language == 'cpp' + run: | + npx node-gyp rebuild - - name: Perform CodeQL Analysis + - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 with: category: "/language:${{matrix.language}}" From 6a8820d8e2a8b5de3e7c951223800b86ba492574 Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 15:05:34 +0100 Subject: [PATCH 06/10] Add or update CodeQL workflow From 1ab21a0a6c3bc9e23dfffb29c48d701744d78e43 Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 17:35:07 +0100 Subject: [PATCH 07/10] Add or update CodeQL workflow --- .github/workflows/codeql.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a941bf0..e17a2d2 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,4 +1,3 @@ - # For most projects, this workflow file will not need changing; you simply need # to commit it to your repository. # From fa888766b5b9c289bf68725ba8074d34794cff97 Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 21:20:18 +0100 Subject: [PATCH 08/10] Add or update CodeQL workflow From b502866196a0dcfa2bd071688c443d1962d7fb99 Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 21:22:33 +0100 Subject: [PATCH 09/10] Add or update CodeQL workflow From 920221fbc49379b10b035890cd81748c6628f9eb Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 21:31:40 +0100 Subject: [PATCH 10/10] Add or update CodeQL workflow --- .github/workflows/codeql.yml | 75 ++++++++++++++++++------------------ 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e17a2d2..e85a358 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,12 +13,12 @@ name: "CodeQL" on: push: - branches: [ "main" ] + branches: ["main"] pull_request: # The branches below must be a subset of the branches above - branches: [ "main" ] + branches: ["main"] schedule: - - cron: '30 14 * * 4' + - cron: "30 14 * * 4" jobs: analyze: @@ -33,49 +33,48 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'cpp', 'javascript' ] + language: ["cpp", "javascript"] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ] # Use only 'java' to analyze code written in Java, Kotlin or both # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support steps: - - name: Checkout repository - uses: actions/checkout@v3 + - name: Checkout repository + uses: actions/checkout@v3 - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # 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. - # Prefix the list here with "+" to use these queries and those in the config file. + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # 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. + # Prefix the list here with "+" to use these queries and those in the config file. - # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - config: | - paths-ignore: - - '**/*.test.js' - - '**/*.spec.js' - - '**/*.test.ts' - - '**/*.spec.ts' - - '**/*.test.tsx' - - '**/*.spec.tsx' + # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + config: | + paths-ignore: + - '**/*.test.js' + - '**/*.spec.js' + - '**/*.test.ts' + - '**/*.spec.ts' + - '**/*.test.tsx' + - '**/*.spec.tsx' - - name: Use Node.js v18.x - if: matrix.language == 'cpp' - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 - with: - node-version: 18.x + - name: Use Node.js v18.x + if: matrix.language == 'cpp' + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 + with: + node-version: 18.x - - name: Build cpp - if: matrix.language == 'cpp' - run: | - npx node-gyp rebuild + - name: Build cpp + if: matrix.language == 'cpp' + run: | + npx node-gyp rebuild - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{matrix.language}}" + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}"