Skip to content

Commit e2161d3

Browse files
committed
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
1 parent c2157b8 commit e2161d3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/setup-stackql-test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ jobs:
3535
echo "Registry list output:"
3636
echo "$OUTPUT"
3737
38-
# When the wrapper is active, @actions/exec writes stackql's stdout directly to the
39-
# wrapper process's stdout, and core.debug() appends ::debug:: annotations immediately
40-
# after (on the same line, since the JSON has no trailing newline). Strip all GitHub
41-
# Actions workflow commands (::name::value) before handing the output to jq.
42-
CLEAN_JSON=$(echo "$OUTPUT" | sed 's/::[a-z-]*::.*$//' | grep -v '^[[:space:]]*$')
38+
# When the wrapper is active, @actions/exec also prints the command line before the
39+
# output, and core.debug() appends ::debug:: annotations immediately after the JSON
40+
# (on the same line, since the JSON has no trailing newline). Strip workflow commands
41+
# and then keep only lines that look like JSON (starting with [ or {).
42+
CLEAN_JSON=$(echo "$OUTPUT" | sed 's/::[a-z-]*::.*$//' | grep -E '^\s*[\[{]')
4343
4444
# Validate JSON structure: array of objects each with provider and version keys
4545
echo "$CLEAN_JSON" | jq -e 'type == "array" and (all(.[]; has("provider") and has("version")))' > /dev/null

0 commit comments

Comments
 (0)