From 3f34c84114744390281fecd072ac5fa2e28ade58 Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 12:55:03 +0100 Subject: [PATCH 1/8] 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 74ae3ce7ec8407a2cb9148ef909f8335826ba82a Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 14:00:00 +0100 Subject: [PATCH 2/8] Add or update CodeQL workflow --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 905b4c1..03551fb 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -14,10 +14,10 @@ name: "CodeQL" on: push: - branches: [ "main" ] + branches: [ "master" ] pull_request: # The branches below must be a subset of the branches above - branches: [ "main" ] + branches: [ "master" ] schedule: - cron: '30 14 * * 4' From 97e8933266612e6c83bd67ca939e23345b84a8e1 Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 14:21:53 +0100 Subject: [PATCH 3/8] Add or update CodeQL workflow From c0ed6e2d003b414a50debfcad5414b81c85a7449 Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 15:06:02 +0100 Subject: [PATCH 4/8] Add or update CodeQL workflow --- .github/workflows/codeql.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 03551fb..ebfc455 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -69,15 +69,6 @@ jobs: - 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 From c54339906c641cbbe9cabab685a2e6ad97e76070 Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 17:35:41 +0100 Subject: [PATCH 5/8] 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 ebfc455..e6f1384 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 08d9a5de691bd7f6eefc1a40eff7781236eed326 Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 21:20:50 +0100 Subject: [PATCH 6/8] Add or update CodeQL workflow From 68c9df575897c44b94f66cf05fcd48891b0f74c5 Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 21:23:02 +0100 Subject: [PATCH 7/8] Add or update CodeQL workflow From d2b1a285cc031a81157c85d9dfca483e712af4f9 Mon Sep 17 00:00:00 2001 From: Maurizio Casimirri Date: Wed, 13 Dec 2023 21:32:09 +0100 Subject: [PATCH 8/8] Add or update CodeQL workflow --- .github/workflows/codeql.yml | 65 ++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e6f1384..902c97c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,12 +13,12 @@ name: "CodeQL" on: push: - branches: [ "master" ] + branches: ["master"] pull_request: # The branches below must be a subset of the branches above - branches: [ "master" ] + branches: ["master"] schedule: - - cron: '30 14 * * 4' + - cron: "30 14 * * 4" jobs: analyze: @@ -33,43 +33,42 @@ jobs: strategy: fail-fast: false matrix: - language: [ 'javascript' ] + 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 + - 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' - # 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 + # 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: 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}}"