From 3701783a507f0588f0beea9d863b36b61e5c3944 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 24 Nov 2025 15:21:47 +0000 Subject: [PATCH 1/4] Initial plan From 3c86a933d3e8c727928a17b4d675bf3e4c7a3258 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 24 Nov 2025 15:26:06 +0000 Subject: [PATCH 2/4] Update CodeQL workflow to build and analyze ESM output only Co-authored-by: kwinto <90881+kwinto@users.noreply.github.com> --- .github/codeql-config.yml | 16 +++++++++++++++ .github/workflows/codeql.yml | 39 +++++++++++++++++------------------- 2 files changed, 34 insertions(+), 21 deletions(-) create mode 100644 .github/codeql-config.yml diff --git a/.github/codeql-config.yml b/.github/codeql-config.yml new file mode 100644 index 00000000..f9318c68 --- /dev/null +++ b/.github/codeql-config.yml @@ -0,0 +1,16 @@ +name: "CodeQL Config" + +# Only analyze the ESM build output +paths: + - dist/webchat.esm.js + +# Ignore everything else +paths-ignore: + - src + - node_modules + - dist/webchat.js + - '**/*.test.js' + - '**/*.html' + - cypress + - docs + - architecture-docs diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2e4914f5..8a6da7fe 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -59,11 +59,18 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - # Add any setup steps before running the `github/codeql-action/init` action. - # This includes steps like installing compilers or runtimes (`actions/setup-node` - # or others). This is typically only required for manual builds. - # - name: Setup runtime (example) - # uses: actions/setup-example@v1 + # Setup Node.js for JavaScript/TypeScript builds + - name: Setup Node.js + if: matrix.language == 'javascript-typescript' + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + + # Install dependencies for JavaScript/TypeScript + - name: Install dependencies + if: matrix.language == 'javascript-typescript' + run: npm ci # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL @@ -71,6 +78,8 @@ jobs: with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} + # Use config file only for JavaScript/TypeScript to limit analysis to ESM build + config-file: ${{ matrix.language == 'javascript-typescript' && './.github/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. # Prefix the list here with "+" to use these queries and those in the config file. @@ -78,22 +87,10 @@ jobs: # 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 - # If the analyze step fails for one of the languages you are analyzing with - # "We were unable to automatically build your code", modify the matrix above - # to set the build mode to "manual" for that language. Then modify this step - # to build your code. - # â„šī¸ 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: Run manual build steps - 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 + # Build ESM bundle for JavaScript/TypeScript analysis + - name: Build ESM bundle + if: matrix.language == 'javascript-typescript' + run: npm run build:esm - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v4 From 5fcf31501905a536891fe6751ee8fc92fb356271 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 24 Nov 2025 15:28:10 +0000 Subject: [PATCH 3/4] Fix build step order: build before CodeQL initialization Co-authored-by: kwinto <90881+kwinto@users.noreply.github.com> --- .github/workflows/codeql.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8a6da7fe..63d0810d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -46,7 +46,7 @@ jobs: - language: actions build-mode: none - language: javascript-typescript - build-mode: none + build-mode: manual # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', '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 @@ -72,6 +72,11 @@ jobs: if: matrix.language == 'javascript-typescript' run: npm ci + # Build ESM bundle for JavaScript/TypeScript analysis + - name: Build ESM bundle + if: matrix.language == 'javascript-typescript' + run: npm run build:esm + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v4 @@ -87,11 +92,6 @@ jobs: # 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 - # Build ESM bundle for JavaScript/TypeScript analysis - - name: Build ESM bundle - if: matrix.language == 'javascript-typescript' - run: npm run build:esm - - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v4 with: From d87781ea9e8305ee001807a73812a93e651fe67d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 24 Nov 2025 15:29:13 +0000 Subject: [PATCH 4/4] Fix config file path - remove ./ prefix Co-authored-by: kwinto <90881+kwinto@users.noreply.github.com> --- .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 63d0810d..13f29014 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -84,7 +84,7 @@ jobs: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} # Use config file only for JavaScript/TypeScript to limit analysis to ESM build - config-file: ${{ matrix.language == 'javascript-typescript' && './.github/codeql-config.yml' || '' }} + config-file: ${{ matrix.language == 'javascript-typescript' && '.github/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. # Prefix the list here with "+" to use these queries and those in the config file.