From 2f202dc1869484028412c5907970cc378be4c433 Mon Sep 17 00:00:00 2001 From: Julian Pawlowski Date: Sat, 4 Jul 2026 19:18:04 +0000 Subject: [PATCH] refactor(generate-notes): improve Copilot CLI integration for release notes generation Enhance the handling of the Copilot CLI to ensure better user-focused output and prevent issues with empty responses. Adjustments include using a pipe for input and adding checks for output validity. Impact: Users receive more accurate and user-friendly release notes without technical jargon. --- scripts/release/generate-notes | 43 ++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/scripts/release/generate-notes b/scripts/release/generate-notes index d47bcb4..b730ffd 100755 --- a/scripts/release/generate-notes +++ b/scripts/release/generate-notes @@ -435,30 +435,53 @@ ${DIFF_CONTEXT} Output ONLY the release notes. Start directly with the # title. End after the Buy Me A Coffee button. No meta-commentary, no explanations." - # Save prompt to temp file for copilot - TEMP_PROMPT=$(mktemp) - echo "$PROMPT" >"$TEMP_PROMPT" - # Use Claude Sonnet for better user-focused, plain-language release notes. # Haiku tends to echo technical commit language; Sonnet better translates to user benefits. # Can override with: COPILOT_MODEL=claude-haiku-4.5 ./scripts/release/generate-notes COPILOT_MODEL="${COPILOT_MODEL:-claude-sonnet-4.6}" - # Call copilot CLI (it will handle authentication interactively) - copilot --model "$COPILOT_MODEL" <"$TEMP_PROMPT" || { + # Call copilot CLI (it will handle authentication interactively). + # Flags matter here (recent copilot CLI versions, e.g. 1.0.68+): + # The prompt is piped into stdin (a real pipe, not a `/dev/null 2>&1; then generate_with_gitcliff else generate_with_manual fi return - } + fi - rm -f "$TEMP_PROMPT" + printf "%s\n" "$COPILOT_OUTPUT" } # ============================================================================