Skip to content

Commit 9b05a0a

Browse files
rajsinghtechclaude
andcommitted
Fix JSON parsing by sending info messages to stderr
The create-tailnet.sh script now sends informational messages to stderr so that only valid JSON is sent to stdout. This fixes the jq parsing error in the workflow where extra text was mixed with JSON output. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 9f5ac19 commit 9b05a0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tailscale/scripts/create-tailnet.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if ! echo "$TAILNET_NAME" | grep -E '^[a-zA-Z0-9_]+$' > /dev/null; then
2020
exit 1
2121
fi
2222

23-
echo "Creating API-only tailnet: $TAILNET_NAME"
23+
echo "Creating API-only tailnet: $TAILNET_NAME" >&2
2424

2525
RESPONSE=$(curl -s -w "\nHTTP_STATUS:%{http_code}" -X POST https://api.tailscale.com/api/v2/organizations/-/tailnets \
2626
--header "Authorization: Bearer $ACCESS_TOKEN" \
@@ -36,5 +36,5 @@ if [ "$HTTP_STATUS" != "200" ]; then
3636
exit 1
3737
fi
3838

39-
echo "Tailnet created successfully:"
39+
echo "Tailnet created successfully:" >&2
4040
echo "$RESPONSE_BODY" | jq .

0 commit comments

Comments
 (0)