Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/actions/setup-codeql-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,23 @@ runs:

echo "✅ GitHub CLI CodeQL extension installed successfully"

# On Windows, gh codeql install-stub creates a bash script which is not
# discoverable by Node.js child_process.spawn(). Create a .cmd wrapper
# so that tools using spawn('codeql', ...) can find the CodeQL CLI.
- name: Create Windows-compatible CodeQL CLI wrapper
if: runner.os == 'Windows'
shell: bash
run: |
CODEQL_STUB_DIR="$HOME/.local/bin"

cat > "$CODEQL_STUB_DIR/codeql.cmd" << 'WRAPPER'
@echo off
gh codeql %*
exit /b %errorlevel%
WRAPPER

echo "✅ Created Windows-compatible CodeQL CLI wrapper at $CODEQL_STUB_DIR/codeql.cmd"

- name: Setup CodeQL environment variables
id: setup-codeql-env
shell: bash
Expand Down
4 changes: 3 additions & 1 deletion client/src/ql-mcp-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ class CodeQLMCPClient {
this.logger.log("Checking for CodeQL CLI availability...");

// Try to run 'codeql version' to check if it's available
// On Windows, explicitly use bash since the CodeQL stub is a bash script
const version = execSync("codeql version", {
encoding: "utf8",
stdio: ["pipe", "pipe", "pipe"],
timeout: 5000
timeout: 5000,
shell: process.platform === "win32" ? "bash" : undefined
}).trim();

this.logger.log(`Found CodeQL CLI: ${version.split("\n")[0]}`);
Expand Down
Loading