Skip to content

Commit d1c7f2f

Browse files
committed
feat: Update CodeQL binary detection logic in workflow
1 parent 556b438 commit d1c7f2f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/codeql-ql.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,20 @@ jobs:
6262
CODEQL_REPOSITORY_PATH="${CODEQL_REPOSITORY_PATH:-$HOME/.codeql/codeql-ql}"
6363
CODEQL_SUITE="${CODEQL_SUITE:-$CODEQL_REPOSITORY_PATH/ql/ql/src/codeql-suites/ql-code-scanning.qls}"
6464
65-
if which codeql >/dev/null; then
65+
# Glob for Actions toolcache
66+
CODEQL_GLOB='$RUNNER_TOOL_CACHE/CodeQL/*/x64/codeql/codeql'
67+
68+
if [ -f "$CODEQL_GLOB" ]; then
69+
CODEQL_BINARY=$(echo $CODEQL_GLOB)
70+
elif which codeql >/dev/null; then
6671
CODEQL_BINARY="codeql"
6772
elif gh codeql >/dev/null; then
6873
CODEQL_BINARY="gh codeql"
6974
else
7075
gh extension install github/gh-codeql
7176
CODEQL_BINARY="gh codeql"
7277
fi
78+
echo "[+] Using codeql binary: $CODEQL_BINARY"
7379
7480
$CODEQL_BINARY database create \
7581
--language ql --overwrite \

0 commit comments

Comments
 (0)