From 7accc792ee977b72cb0ab4edae4cd03ec23d040f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Mar 2026 21:31:10 +0000 Subject: [PATCH 1/6] print stackql version in action logs and update test to validate registry list - index.js: run stackql --version after setup and log output to action logs (runs before wrapper install to use the original binary name) - workflow: replace version check test with stackql exec REGISTRY LIST test that validates the JSON response is an array of {provider, version} objects https://claude.ai/code/session_01Y8NseCm28GqE8nQ1Yvg5aa --- .github/workflows/setup-stackql-test.yml | 31 ++++++------------------ dist/index.js | 7 ++++++ index.js | 7 ++++++ 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/.github/workflows/setup-stackql-test.yml b/.github/workflows/setup-stackql-test.yml index b9e2935..e4c90f6 100644 --- a/.github/workflows/setup-stackql-test.yml +++ b/.github/workflows/setup-stackql-test.yml @@ -29,29 +29,12 @@ jobs: with: use_wrapper: ${{matrix.use_wrapper}} - - name: Get Stackql Version - id: get-stackql-version + - name: Run Registry List and Validate run: | - echo "stackql_version<> $GITHUB_ENV - stackql --version >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV + OUTPUT=$(stackql exec --output json "REGISTRY LIST") + echo "Registry list output:" + echo "$OUTPUT" - - name: Validate Stackql Version - run: | - # Extract only the relevant line containing version information - VERSION_OUTPUT=$(echo "${{ env.stackql_version }}" | grep -E 'stackql v[0-9]+\.[0-9]+\.[0-9]+') - echo "Version output: $VERSION_OUTPUT" - - SEMVER_REGEX="v[0-9]+\.[0-9]+\.[0-9]+" - PLATFORM_REGEX="(Linux|Darwin|Windows|Homebrew)" - - if ! [[ "$VERSION_OUTPUT" =~ $SEMVER_REGEX ]]; then - echo "Semantic version does not match expected format" - exit 1 - fi - if ! [[ "$VERSION_OUTPUT" =~ $PLATFORM_REGEX ]]; then - echo "Platform information does not match expected formats" - exit 1 - fi - - echo "version output validated successfully." \ No newline at end of file + # Validate JSON structure: array of objects each with provider and version keys + echo "$OUTPUT" | jq -e 'type == "array" and (all(.[]; has("provider") and has("version")))' > /dev/null + echo "Registry list validated successfully." \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 5380714..69af66a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -34544,6 +34544,13 @@ async function setup () { await makeExecutable(cliPath, osPlatform); } + // Print stackql version to action logs + const exeSuffix = osPlatform === 'win32' ? '.exe' : ''; + const stackqlBin = external_path_namespaceObject.join(cliPath, `stackql${exeSuffix}`); + info('stackql version:'); + const versionOutput = (0,external_child_process_namespaceObject.execSync)(`"${stackqlBin}" --version`, { encoding: 'utf-8' }); + info(versionOutput.trim()); + // Check if wrapper is needed and if it's not Darwin const useWrapper = getInput('use_wrapper') === 'true'; if (useWrapper && osPlatform !== 'darwin') { diff --git a/index.js b/index.js index 7df7da9..124f4df 100644 --- a/index.js +++ b/index.js @@ -118,6 +118,13 @@ async function setup () { await makeExecutable(cliPath, osPlatform); } + // Print stackql version to action logs + const exeSuffix = osPlatform === 'win32' ? '.exe' : ''; + const stackqlBin = path.join(cliPath, `stackql${exeSuffix}`); + core.info('stackql version:'); + const versionOutput = execSync(`"${stackqlBin}" --version`, { encoding: 'utf-8' }); + core.info(versionOutput.trim()); + // Check if wrapper is needed and if it's not Darwin const useWrapper = core.getInput('use_wrapper') === 'true'; if (useWrapper && osPlatform !== 'darwin') { From c2157b8057c49960bf7a5fa5c2ba1935dd32b710 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Mar 2026 22:03:01 +0000 Subject: [PATCH 2/6] fix: strip wrapper debug annotations before jq validation in test When use_wrapper=true, @actions/exec writes stackql's stdout directly to the wrapper process's stdout AND the wrapper emits ::debug:: annotations via core.debug(). Since the JSON output has no trailing newline, the debug text is appended on the same line (e.g. [{...}]::debug::StackQL exited...). Strip all ::name::value GitHub Actions workflow commands from captured output before piping to jq. https://claude.ai/code/session_01Y8NseCm28GqE8nQ1Yvg5aa --- .github/workflows/setup-stackql-test.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/setup-stackql-test.yml b/.github/workflows/setup-stackql-test.yml index e4c90f6..e9b1854 100644 --- a/.github/workflows/setup-stackql-test.yml +++ b/.github/workflows/setup-stackql-test.yml @@ -35,6 +35,12 @@ jobs: echo "Registry list output:" echo "$OUTPUT" + # When the wrapper is active, @actions/exec writes stackql's stdout directly to the + # wrapper process's stdout, and core.debug() appends ::debug:: annotations immediately + # after (on the same line, since the JSON has no trailing newline). Strip all GitHub + # Actions workflow commands (::name::value) before handing the output to jq. + CLEAN_JSON=$(echo "$OUTPUT" | sed 's/::[a-z-]*::.*$//' | grep -v '^[[:space:]]*$') + # Validate JSON structure: array of objects each with provider and version keys - echo "$OUTPUT" | jq -e 'type == "array" and (all(.[]; has("provider") and has("version")))' > /dev/null + echo "$CLEAN_JSON" | jq -e 'type == "array" and (all(.[]; has("provider") and has("version")))' > /dev/null echo "Registry list validated successfully." \ No newline at end of file From e2161d33ea586cf72eb4a9c0ab8a1cdc5b785b6f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Mar 2026 22:10:41 +0000 Subject: [PATCH 3/6] fix: strip wrapper command line from stackql output before jq parsing The wrapper prints the binary path + args as the first line of output, which is not JSON. grep -E '^\s*[\[{]' keeps only lines that are actual JSON, discarding both that command line and any leftover blank lines. https://claude.ai/code/session_01Y8NseCm28GqE8nQ1Yvg5aa --- .github/workflows/setup-stackql-test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/setup-stackql-test.yml b/.github/workflows/setup-stackql-test.yml index e9b1854..d573f65 100644 --- a/.github/workflows/setup-stackql-test.yml +++ b/.github/workflows/setup-stackql-test.yml @@ -35,11 +35,11 @@ jobs: echo "Registry list output:" echo "$OUTPUT" - # When the wrapper is active, @actions/exec writes stackql's stdout directly to the - # wrapper process's stdout, and core.debug() appends ::debug:: annotations immediately - # after (on the same line, since the JSON has no trailing newline). Strip all GitHub - # Actions workflow commands (::name::value) before handing the output to jq. - CLEAN_JSON=$(echo "$OUTPUT" | sed 's/::[a-z-]*::.*$//' | grep -v '^[[:space:]]*$') + # When the wrapper is active, @actions/exec also prints the command line before the + # output, and core.debug() appends ::debug:: annotations immediately after the JSON + # (on the same line, since the JSON has no trailing newline). Strip workflow commands + # and then keep only lines that look like JSON (starting with [ or {). + CLEAN_JSON=$(echo "$OUTPUT" | sed 's/::[a-z-]*::.*$//' | grep -E '^\s*[\[{]') # Validate JSON structure: array of objects each with provider and version keys echo "$CLEAN_JSON" | jq -e 'type == "array" and (all(.[]; has("provider") and has("version")))' > /dev/null From 86853c4231c2524f4b56e061e517ded62aa18ffb Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Mar 2026 22:17:53 +0000 Subject: [PATCH 4/6] fix: use table output and GITHUB_ENV for registry list validation Avoids jq dependency and wrapper stdout pollution. Captures table-format output via GITHUB_ENV multiline syntax, then validates header and first data row with regex (same pattern as the version check step). https://claude.ai/code/session_01Y8NseCm28GqE8nQ1Yvg5aa --- .github/workflows/setup-stackql-test.yml | 34 ++++++++++++++++-------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/setup-stackql-test.yml b/.github/workflows/setup-stackql-test.yml index d573f65..ca6f7df 100644 --- a/.github/workflows/setup-stackql-test.yml +++ b/.github/workflows/setup-stackql-test.yml @@ -29,18 +29,30 @@ jobs: with: use_wrapper: ${{matrix.use_wrapper}} - - name: Run Registry List and Validate + - name: Run Registry List + id: run-registry-list run: | - OUTPUT=$(stackql exec --output json "REGISTRY LIST") - echo "Registry list output:" - echo "$OUTPUT" + echo "registry_list_output<> $GITHUB_ENV + stackql exec "REGISTRY LIST" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV - # When the wrapper is active, @actions/exec also prints the command line before the - # output, and core.debug() appends ::debug:: annotations immediately after the JSON - # (on the same line, since the JSON has no trailing newline). Strip workflow commands - # and then keep only lines that look like JSON (starting with [ or {). - CLEAN_JSON=$(echo "$OUTPUT" | sed 's/::[a-z-]*::.*$//' | grep -E '^\s*[\[{]') + - name: Validate Registry List + run: | + echo "Registry list output:" + echo "${{ env.registry_list_output }}" + + # Validate header row: expect | provider | and | version | columns + HEADER_REGEX='\|\s*provider\s*\|\s*version\s*\|' + if ! [[ "${{ env.registry_list_output }}" =~ $HEADER_REGEX ]]; then + echo "Registry list header does not match expected format" + exit 1 + fi + + # Validate at least one data row: | | v.. | + DATA_ROW_REGEX='\|\s*[a-z][a-z0-9_]*\s*\|\s*v[0-9]+\.[0-9]+\.[0-9]+\s*\|' + if ! [[ "${{ env.registry_list_output }}" =~ $DATA_ROW_REGEX ]]; then + echo "Registry list does not contain a valid data row" + exit 1 + fi - # Validate JSON structure: array of objects each with provider and version keys - echo "$CLEAN_JSON" | jq -e 'type == "array" and (all(.[]; has("provider") and has("version")))' > /dev/null echo "Registry list validated successfully." \ No newline at end of file From 3b6d999a624ab574def86bf86e1f7c6cea886d16 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Mar 2026 22:20:27 +0000 Subject: [PATCH 5/6] fix: use [[:space:]] instead of \s for macOS bash 3.2 compatibility macOS ships bash 3.2 which does not support \s in =~ regex patterns. Replace with POSIX [[:space:]] which works on all platforms. https://claude.ai/code/session_01Y8NseCm28GqE8nQ1Yvg5aa --- .github/workflows/setup-stackql-test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/setup-stackql-test.yml b/.github/workflows/setup-stackql-test.yml index ca6f7df..e1f74ac 100644 --- a/.github/workflows/setup-stackql-test.yml +++ b/.github/workflows/setup-stackql-test.yml @@ -42,14 +42,15 @@ jobs: echo "${{ env.registry_list_output }}" # Validate header row: expect | provider | and | version | columns - HEADER_REGEX='\|\s*provider\s*\|\s*version\s*\|' + # Use [[:space:]] instead of \s for macOS bash 3.2 compatibility + HEADER_REGEX='\|[[:space:]]*provider[[:space:]]*\|[[:space:]]*version[[:space:]]*\|' if ! [[ "${{ env.registry_list_output }}" =~ $HEADER_REGEX ]]; then echo "Registry list header does not match expected format" exit 1 fi # Validate at least one data row: | | v.. | - DATA_ROW_REGEX='\|\s*[a-z][a-z0-9_]*\s*\|\s*v[0-9]+\.[0-9]+\.[0-9]+\s*\|' + DATA_ROW_REGEX='\|[[:space:]]*[a-z][a-z0-9_]*[[:space:]]*\|[[:space:]]*v[0-9]+\.[0-9]+\.[0-9]+[[:space:]]*\|' if ! [[ "${{ env.registry_list_output }}" =~ $DATA_ROW_REGEX ]]; then echo "Registry list does not contain a valid data row" exit 1 From c06ca6ba052d87490862c6d9c82a6943f54e66f1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Mar 2026 22:23:16 +0000 Subject: [PATCH 6/6] fix: use shell var $registry_list_output instead of ${{ }} expansion ${{ env.registry_list_output }} causes GitHub Actions to inline the raw table content (with | pipes and newlines) directly into the bash script before the shell parses it, breaking [[ ]] conditionals on Windows. Using the shell env var avoids the inline substitution entirely. https://claude.ai/code/session_01Y8NseCm28GqE8nQ1Yvg5aa --- .github/workflows/setup-stackql-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/setup-stackql-test.yml b/.github/workflows/setup-stackql-test.yml index e1f74ac..172dc1f 100644 --- a/.github/workflows/setup-stackql-test.yml +++ b/.github/workflows/setup-stackql-test.yml @@ -39,19 +39,19 @@ jobs: - name: Validate Registry List run: | echo "Registry list output:" - echo "${{ env.registry_list_output }}" + echo "$registry_list_output" # Validate header row: expect | provider | and | version | columns # Use [[:space:]] instead of \s for macOS bash 3.2 compatibility HEADER_REGEX='\|[[:space:]]*provider[[:space:]]*\|[[:space:]]*version[[:space:]]*\|' - if ! [[ "${{ env.registry_list_output }}" =~ $HEADER_REGEX ]]; then + if ! [[ "$registry_list_output" =~ $HEADER_REGEX ]]; then echo "Registry list header does not match expected format" exit 1 fi # Validate at least one data row: | | v.. | DATA_ROW_REGEX='\|[[:space:]]*[a-z][a-z0-9_]*[[:space:]]*\|[[:space:]]*v[0-9]+\.[0-9]+\.[0-9]+[[:space:]]*\|' - if ! [[ "${{ env.registry_list_output }}" =~ $DATA_ROW_REGEX ]]; then + if ! [[ "$registry_list_output" =~ $DATA_ROW_REGEX ]]; then echo "Registry list does not contain a valid data row" exit 1 fi