Skip to content
Merged
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
14 changes: 12 additions & 2 deletions scripts/publish-extractor-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ EXTRACTOR_VERSION=$(grep version $EXTRACTOR_INFO | awk '{print $2}')

LATEST_RELEASE=$(gh release list | head -n 1 | awk '{print $1}' | sed 's/v//')

if which codeql >/dev/null 2>&1; then
CODEQL_BINARY="codeql"
elif gh codeql version >/dev/null 2>&1; then
CODEQL_BINARY="gh codeql"
else
gh extension install github/gh-codeql
CODEQL_BINARY="gh codeql"
Copy link
Preview

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

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

If the gh-codeql extension installation fails, the script will continue executing and may fail later when trying to use $CODEQL_BINARY. Consider adding error handling to check if the installation succeeded.

Suggested change
CODEQL_BINARY="gh codeql"
if gh codeql >/dev/null; then
CODEQL_BINARY="gh codeql"
else
echo "[!] Failed to install gh-codeql extension or 'gh codeql' is not available."
exit 1
fi

Copilot uses AI. Check for mistakes.

fi

echo "[+] ${EXTRACTOR_NAME} (${EXTRACTOR_VERSION})"
echo "[+] Last release: ${LATEST_RELEASE}"

Expand All @@ -20,8 +29,9 @@ if [ "$LATEST_RELEASE" != "$EXTRACTOR_VERSION" ]; then
exit 1
fi

# echo "[+] Add queries to extractor-pack"
# $CODEQL_BINARY pack create --output=./extractor-pack/queries ./ql/src
echo "[+] Add queries to extractor-pack"
$CODEQL_BINARY pack create --output=./extractor-pack/qlpacks ./ql/lib
$CODEQL_BINARY pack create --output=./extractor-pack/qlpacks ./ql/src

# bundle extractor
tar czf extractor-$EXTRACTOR_NAME.tar.gz extractor-pack
Expand Down