From 4ec47fa7ef904ec33cf1e272a196473793c07503 Mon Sep 17 00:00:00 2001 From: anonpenguin23 Date: Mon, 3 Nov 2025 07:17:18 +0200 Subject: [PATCH] refactor: simplify JSON payload construction in update_changelog.sh - Improved the construction of the JSON request body for the OpenRouter API by using a here-document for better readability and maintainability. - Ensured proper escaping of the prompt content to prevent issues with special characters in the API request. --- scripts/update_changelog.sh | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/scripts/update_changelog.sh b/scripts/update_changelog.sh index 45ae134..02715d6 100755 --- a/scripts/update_changelog.sh +++ b/scripts/update_changelog.sh @@ -132,22 +132,27 @@ Rules: # Call OpenRouter API log "Calling OpenRouter API to generate changelog..." +# Prepare the JSON payload properly +PROMPT_ESCAPED=$(echo "$PROMPT" | jq -Rs .) +REQUEST_BODY=$(cat <