From 4e58a45a4985167504385f88222432e664d5f753 Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Tue, 21 May 2024 13:17:40 -0600 Subject: [PATCH 1/5] Create codeql.yml --- .github/workflows/codeql.yml | 67 ++++++++++++++++++++++++++++++++++++ 1 file changed, 67 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 00000000..eadbec17 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,67 @@ +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: '0 0 * * *' # at midnight each day + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + # Runner size impacts CodeQL analysis time. To learn more, please see: + # - https://gh.io/recommended-hardware-resources-for-running-codeql + # - https://gh.io/supported-runners-and-hardware-resources + # - https://gh.io/using-larger-runners (GitHub.com only) + # Consider using larger runners or machines with greater resources for possible analysis time improvements. + runs-on: 'ubuntu-latest' + timeout-minutes: 360 + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: javascript-typescript + build-mode: none + # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' + # Use `c-cpp` to analyze code written in C, C++ or both + # Use 'java-kotlin' to analyze code written in Java, Kotlin or both + # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both + # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, + # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. + # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how + # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + # 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 + source-root: "./src" + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" From 8b84f0e6ae384320cc212b6b1003c76eb363636c Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Wed, 22 May 2024 09:04:41 -0600 Subject: [PATCH 2/5] Update codeql.yml --- .github/workflows/codeql.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index eadbec17..60f4da85 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -5,8 +5,6 @@ on: branches: [ "main" ] pull_request: branches: [ "main" ] - schedule: - - cron: '0 0 * * *' # at midnight each day jobs: analyze: From 6d8ae169eea036982893c99a67c76ee168ac46a0 Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Wed, 22 May 2024 09:19:10 -0600 Subject: [PATCH 3/5] Update codeql.yml --- .github/workflows/codeql.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 60f4da85..9b62bc28 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -32,7 +32,13 @@ jobs: matrix: include: - language: javascript-typescript - build-mode: none + build-mode: manual + identifier: 'source' + root: './src' + - language: javascript-typescript + build-mode: manual + identifier: 'bundled' + root: './lib' # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' # Use `c-cpp` to analyze code written in C, C++ or both # Use 'java-kotlin' to analyze code written in Java, Kotlin or both @@ -51,15 +57,14 @@ jobs: with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} - # 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 - source-root: "./src" + source-root: ${{matrix.root}} + + - if: matrix.build-mode == 'manual' + shell: bash + run: | + npm install - - name: Perform CodeQL Analysis + - name: Perform CodeQL Analysis ${{matrix.identifier}} uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" From 1a092953279ac4d76aaf86cb59ce51559ee9c54e Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Wed, 22 May 2024 09:20:34 -0600 Subject: [PATCH 4/5] Update codeql.yml --- .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 9b62bc28..5286f9d1 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -8,7 +8,7 @@ on: jobs: analyze: - name: Analyze (${{ matrix.language }}) + name: Analyze (${{ matrix.language }} - ${{ matrix.identifier }}) # Runner size impacts CodeQL analysis time. To learn more, please see: # - https://gh.io/recommended-hardware-resources-for-running-codeql # - https://gh.io/supported-runners-and-hardware-resources From ccc15864db3a9fc72de3d8c6eb445cdf9cb3f7ad Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Wed, 22 May 2024 09:31:15 -0600 Subject: [PATCH 5/5] Update codeql.yml --- .github/workflows/codeql.yml | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5286f9d1..04fe867c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -32,37 +32,27 @@ jobs: matrix: include: - language: javascript-typescript - build-mode: manual + build-mode: none identifier: 'source' root: './src' - language: javascript-typescript - build-mode: manual + build-mode: none identifier: 'bundled' root: './lib' - # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' - # Use `c-cpp` to analyze code written in C, C++ or both - # Use 'java-kotlin' to analyze code written in Java, Kotlin or both - # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both - # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis, - # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning. - # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how - # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages steps: - name: Checkout repository uses: actions/checkout@v4 - # Initializes the CodeQL tools for scanning. + - name: Install + shell: bash + run: npm install + - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} source-root: ${{matrix.root}} - - - if: matrix.build-mode == 'manual' - shell: bash - run: | - npm install - name: Perform CodeQL Analysis ${{matrix.identifier}} uses: github/codeql-action/analyze@v3