fix: gen-release-notes improvements#191
Conversation
The usage spec environment variables (usage_version, usage_prev_version) weren't being set correctly in the GitHub Actions environment. Switch to using $1 and $2 positional arguments directly, consistent with mise. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The PR title already contains the version, so strip the redundant version header (## [version] - date) from the PR body. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes issues in the release notes generation script that were discovered during the v1.9.0 release. The changes ensure the script works properly in GitHub Actions by using positional arguments instead of environment variables, adds validation to prevent empty output, and removes redundant version headers from PR descriptions.
Changes:
- Replaced USAGE spec environment variables with positional arguments in
gen-release-notes - Added validation to ensure Claude returns non-empty output before using it
- Removed version header from PR body to avoid duplication with PR title
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| mise-tasks/gen-release-notes | Switched from environment variables to positional args and added empty output validation |
| mise-tasks/release-plz | Strips first two lines of unreleased notes to remove redundant version header |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Validate we got non-empty output | ||
| if [[ -z $output ]]; then | ||
| echo "Error: Claude returned empty output" >&2 | ||
| exit 1 |
There was a problem hiding this comment.
The error message indicates that the script will exit when Claude returns empty output, but the PR description mentions 'ensure fallback to CHANGELOG.md works.' The current implementation exits instead of falling back. Either update the error message to clarify there is no fallback, or implement the fallback logic described in the PR.
| # Validate we got non-empty output | |
| if [[ -z $output ]]; then | |
| echo "Error: Claude returned empty output" >&2 | |
| exit 1 | |
| # Validate we got non-empty output, fall back to raw changelog if needed | |
| if [[ -z $output ]]; then | |
| echo "Warning: Claude returned empty output, falling back to raw changelog" >&2 | |
| output="$changelog" |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| # Get the unreleased notes for PR body | ||
| PR_BODY="$(git cliff --bump --unreleased --strip all)" | ||
| # Strip version header since PR title already has version | ||
| PR_BODY="$(git cliff --bump --unreleased --strip all | tail -n +3)" |
There was a problem hiding this comment.
Stripping two lines removes first section header
Medium Severity
The tail -n +3 command strips two lines from git cliff output, but according to cliff.toml, there's no blank line between the version header and the first section header. This means both the version line (e.g., ## [1.9.1] - date) AND the first section header (e.g., ### 🚀 Features) get stripped. The PR body ends up missing its first section header, starting with an orphaned bullet point instead of a properly formatted markdown section.
- Fall back to raw changelog when Claude returns empty output (Copilot) - Make dry run output match actual PR body format (Cursor) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Log version, previous version, and changelog length before calling Claude - Capture stderr from Claude CLI and display on failure - Helps diagnose why LLM generation fails in CI Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Avoid polluting release notes output by redirecting stderr to a temp file instead of merging with stdout (2>&1). This prevents Claude CLI diagnostic messages from appearing in the release notes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
### 🐛 Bug Fixes - gen-release-notes improvements by [@jdx](https://github.com/jdx) in [#191](#191) ### 🔍 Other Changes - exclude CHANGELOG.md from prettier by [@jdx](https://github.com/jdx) in [#190](#190)
Summary
$1,$2) instead of usage spec environment variables ingen-release-notes- the env vars weren't being set correctly in GitHub ActionsThese fixes address issues discovered after the v1.9.0 release where LLM generation failed.
🤖 Generated with Claude Code
Note
Strengthens release automation and cleans PR body formatting.
gen-release-notes: add debug logging to stderr, capture Claude CLI stderr via a temp file, handle CLI failures explicitly, and validate non-empty model output before emittingrelease-plz: strip the version header from unreleased changelog output (tail -n +3) for both dry-run display and PR bodyWritten by Cursor Bugbot for commit 70c799d. This will update automatically on new commits. Configure here.