Skip to content

Conversation

@aleister1102
Copy link

No description provided.

Copilot AI review requested due to automatic review settings December 12, 2025 19:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the semgrep security scanning workflow with CodeQL for advanced security analysis of JavaScript/TypeScript code. The new workflow is configured to run on pushes, pull requests, weekly on Wednesdays, and can be manually triggered.

Key changes:

  • Adds CodeQL workflow with security-extended and security-and-quality query packs
  • Configures automated scanning for JavaScript/TypeScript codebase
  • Sets up workflow to run on multiple Node.js versions (18 and 20) with static analysis mode

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +45 to +54
- name: Cache node modules
uses: actions/cache@v4
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}-

Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cache step is redundant because the setup-node action (line 40-43) already handles caching with the 'cache: npm' parameter. Having both can lead to cache conflicts and unnecessary overhead. Consider removing this manual cache step and relying on the built-in caching from setup-node.

Suggested change
- name: Cache node modules
uses: actions/cache@v4
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}-

Copilot uses AI. Check for mistakes.
Comment on lines +71 to +75
- name: Autobuild (CodeQL)
uses: github/codeql-action/autobuild@v4
env:
CI: true

Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The matrix specifies 'build-mode: none' but the workflow includes an Autobuild step. When build-mode is 'none', CodeQL analyzes the code without building it, making the Autobuild step unnecessary. Either remove the Autobuild step (recommended for JavaScript/TypeScript projects which typically don't need building for CodeQL analysis) or change build-mode to 'autobuild' if building is required.

Suggested change
- name: Autobuild (CodeQL)
uses: github/codeql-action/autobuild@v4
env:
CI: true

Copilot uses AI. Check for mistakes.
Comment on lines +55 to +62
- name: Install dependencies
run: |
if [ -f package-lock.json ]; then
npm ci
else
npm install
fi

Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing dependencies is unnecessary when using build-mode 'none' for JavaScript/TypeScript analysis. CodeQL can analyze the source code directly without installed dependencies. This step adds unnecessary time to the workflow execution. Consider removing this step or only including it if you change to a build mode that requires it.

Suggested change
- name: Install dependencies
run: |
if [ -f package-lock.json ]; then
npm ci
else
npm install
fi

Copilot uses AI. Check for mistakes.
Comment on lines +39 to +62
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'

- name: Cache node modules
uses: actions/cache@v4
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}-

- name: Install dependencies
run: |
if [ -f package-lock.json ]; then
npm ci
else
npm install
fi

Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting up Node.js is unnecessary for CodeQL analysis with build-mode 'none'. CodeQL for JavaScript/TypeScript performs static analysis on the source code and doesn't require a Node.js runtime or dependencies. This step (along with the cache and install steps) can be removed to speed up the workflow.

Suggested change
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
- name: Cache node modules
uses: actions/cache@v4
with:
path: |
~/.npm
node_modules
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}-
- name: Install dependencies
run: |
if [ -f package-lock.json ]; then
npm ci
else
npm install
fi

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +31
strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
node: 18
build-mode: none
- language: javascript-typescript
node: 20
build-mode: none
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The matrix strategy runs CodeQL analysis twice (once for Node 18 and once for Node 20), but since build-mode is 'none', the Node version doesn't affect the analysis results. CodeQL analyzes the source code statically without executing it. Running duplicate analyses wastes CI resources and time. Consider removing the matrix and running a single analysis job, or if you need to test against multiple Node versions, use the existing Node.js CI workflow instead.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant