Skip to content

Commit 3a131a8

Browse files
committed
Remove heredoc entirely, use only jq for JSON generation
1 parent b7ad768 commit 3a131a8

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

.github/workflows/generate-site.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,12 @@ jobs:
3232
env:
3333
ANTHROPIC_API_KEY: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
3434
run: |
35-
# Build JSON request
36-
PROMPT=$(cat full_prompt.txt | jq -Rs .)
37-
38-
cat > request.json <<EOF
39-
{
40-
"model": "claude-sonnet-4-20250514",
41-
"max_tokens": 8192,
42-
"messages": [{
43-
"role": "user",
44-
"content": $PROMPT
45-
}]
46-
}
47-
EOF
35+
# Build JSON request with jq
36+
jq -n \
37+
--arg model "claude-sonnet-4-20250514" \
38+
--rawfile content full_prompt.txt \
39+
'{ model: $model, max_tokens: 8192, messages: [{ role: "user", content: $content }] }' \
40+
> request.json
4841
4942
# Call Claude API
5043
curl -s https://api.anthropic.com/v1/messages \

0 commit comments

Comments
 (0)