@@ -162,21 +162,24 @@ runs:
162162 run : |
163163 echo "🔧 Locating actual codeql.exe binary for Windows compatibility..."
164164
165- # Determine the gh-codeql data directory
166- GH_CODEQL_DIR="${LOCALAPPDATA:-$HOME/AppData/Local}/GitHub/gh-codeql"
167-
168- if [ ! -d "$GH_CODEQL_DIR" ]; then
169- echo "❌ Error: gh-codeql data directory not found at $GH_CODEQL_DIR"
170- exit 1
165+ # The gh-codeql extension stores the CodeQL CLI binary under the
166+ # GitHub CLI extensions directory. On Windows runners this is:
167+ # $LOCALAPPDATA/GitHub CLI/extensions/gh-codeql/dist/release/<version>/
168+ GH_EXTENSIONS_DIR="${LOCALAPPDATA:-$HOME/AppData/Local}/GitHub CLI/extensions/gh-codeql"
169+
170+ if [ ! -d "$GH_EXTENSIONS_DIR" ]; then
171+ echo "⚠️ gh-codeql extensions directory not found at: $GH_EXTENSIONS_DIR"
172+ echo "Searching more broadly under LOCALAPPDATA..."
173+ GH_EXTENSIONS_DIR="${LOCALAPPDATA:-$HOME/AppData/Local}"
171174 fi
172175
173176 # Find the codeql.exe binary in the gh-codeql distribution
174- CODEQL_EXE=$(find "$GH_CODEQL_DIR " -name "codeql.exe" -type f 2>/dev/null | head -1)
177+ CODEQL_EXE=$(find "$GH_EXTENSIONS_DIR " -name "codeql.exe" -type f 2>/dev/null | head -1)
175178
176179 if [ -z "$CODEQL_EXE" ]; then
177- echo "❌ Error: codeql.exe not found in $GH_CODEQL_DIR "
178- echo "Directory contents :"
179- find "$GH_CODEQL_DIR " -maxdepth 3 -type f | head -20
180+ echo "❌ Error: codeql.exe not found under $GH_EXTENSIONS_DIR "
181+ echo "Directory listing (top 30 files) :"
182+ find "$GH_EXTENSIONS_DIR " -maxdepth 5 -type f 2>/dev/null | head -30
180183 exit 1
181184 fi
182185
0 commit comments