From c8bfb4ecfeb86224da44b6ff80a93cc17e588e39 Mon Sep 17 00:00:00 2001 From: GeekMasher Date: Thu, 7 Aug 2025 17:39:55 +0100 Subject: [PATCH 1/3] feat(scripts): Update the publish script --- scripts/publish-extractor-pack.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/publish-extractor-pack.sh b/scripts/publish-extractor-pack.sh index 6d72a5a..d794158 100755 --- a/scripts/publish-extractor-pack.sh +++ b/scripts/publish-extractor-pack.sh @@ -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; then + CODEQL_BINARY="codeql" +elif gh codeql >/dev/null; then + CODEQL_BINARY="gh codeql" +else + gh extension install github/gh-codeql + CODEQL_BINARY="gh codeql" +fi + echo "[+] ${EXTRACTOR_NAME} (${EXTRACTOR_VERSION})" echo "[+] Last release: ${LATEST_RELEASE}" @@ -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 From 1973f69b500ba8bbfe1c57c4ab3e73fb8d4143db Mon Sep 17 00:00:00 2001 From: Mathew Payne <2772944+GeekMasher@users.noreply.github.com> Date: Thu, 7 Aug 2025 17:41:49 +0100 Subject: [PATCH 2/3] Update scripts/publish-extractor-pack.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- scripts/publish-extractor-pack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/publish-extractor-pack.sh b/scripts/publish-extractor-pack.sh index d794158..d5ba0da 100755 --- a/scripts/publish-extractor-pack.sh +++ b/scripts/publish-extractor-pack.sh @@ -10,7 +10,7 @@ LATEST_RELEASE=$(gh release list | head -n 1 | awk '{print $1}' | sed 's/v//') if which codeql >/dev/null; then CODEQL_BINARY="codeql" -elif gh codeql >/dev/null; then +elif gh codeql version >/dev/null 2>&1; then CODEQL_BINARY="gh codeql" else gh extension install github/gh-codeql From e81ddd368a8d8cb6914df8ac5c4c3278b7a038ea Mon Sep 17 00:00:00 2001 From: GeekMasher Date: Thu, 7 Aug 2025 17:45:01 +0100 Subject: [PATCH 3/3] fix: Redirect stderr to /dev/null in codeql check --- scripts/publish-extractor-pack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/publish-extractor-pack.sh b/scripts/publish-extractor-pack.sh index d5ba0da..dd00c96 100755 --- a/scripts/publish-extractor-pack.sh +++ b/scripts/publish-extractor-pack.sh @@ -8,7 +8,7 @@ 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; then +if which codeql >/dev/null 2>&1; then CODEQL_BINARY="codeql" elif gh codeql version >/dev/null 2>&1; then CODEQL_BINARY="gh codeql"