Repository navigation
fix(release): fail before tagging when release notes exceed the API limit - #875
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Limit details: You’ve used the included review currently available. Your 67 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. WalkthroughThe release workflow adds a configurable limit for dry-run release notes. When notes exceed a positive limit, the workflow fails before the real release step. The documentation describes the limit, its default, and how to disable the check. ChangesRelease Notes Size Guard
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Fixed issue severity: Merge Risk: ⚪ Minimal · up to The workflow checks pending release notes before the real release step, and its documented limit behavior matches the implementation. No actionable merge risk remains. Pre-merge checks |
|
🔍 Lint Analysis
|
🔍 PR Validation Summary✅ PR Mergeable — no blocking failures
|
🛡️ CodeQL Analysis ResultsLanguages analyzed: ✅ No security issues found. 🔍 View full scan logs | 🛡️ Security tab |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@coderabbitai review |
✅ Action performedReview finished.
|
Description
Publishing the first stable release of a repository with a long prerelease history fails late and leaves the repository half-released.
With no previous stable tag,
@semantic-release/release-notes-generatorbuilds the notes from the whole history. The GitHub Releases API rejects a body over 125 000 characters, and@semantic-release/githubonly hits that limit in itspublishstep — after the tag has been created and pushed. The tag then fires the caller's tag-push build and reaches production, while the Release, the changelog, the announcement and the native backmerge are all skipped. With the stable tag never reachingbackmerge_target, the prerelease guard fails every later push to that branch until someone backmerges by hand. This is what happened inLerianStudio/plugin-br-payments(2926 commits, tagv1.0.0left orphaned).This PR makes
release.ymlcatch it before anything is published:Determine next version (dry-run)now runs on every branch, not only on the prerelease lines.pre_synconly ever runs on a prerelease branch, so on a stable branch its two conditions are vacuously true and the step behaves exactly as before where it already ran.Guard against stale prereleasekeeps its prerelease-only scope — it gained an explicitis_prerelease == 'true'condition, since the dry-run it depends on is no longer prerelease-gated. No behavior change.Guard against oversized release notesmeasures the dry-run notes and fails the run before the realSemantic Releasestep. On failure there is no tag, no deployed build and nothing to clean up, and the error explains how to unblock.release_notes_max_chars(number, default125000,0disables).Not in scope: truncating the notes, or generating them from the last prerelease. Both require replacing
@semantic-release/release-notes-generatorin the consumer's.releaserc— semantic-release concatenates the results of thegenerateNotesplugins rather than replacing them, so no additional plugin can shorten another plugin's notes. That would mean this workflow rewriting each repository's.releaserc, which deserves its own issue. This PR delivers what the issue calls the minimum: stop before the tag.Affected workflow:
release.yml(reached bygo-release.yml,js-release.yml,self-release.yml).Type of Change
fix: Bug fix in a workflow (incorrect behavior, broken step, wrong condition)feat: New workflow or new input/output/step in an existing workflowBreaking Changes
None. The new input defaults to the limit the API already enforces, so the guard can only stop a release that would have failed anyway — one step earlier, and without the orphan tag. The extra dry-run on stable branches adds one semantic-release invocation and publishes nothing.
Testing
actionlint .github/workflows/release.ymlclean@this-branchor the beta tagCaller repo / workflow run: n/a — reproducing it needs a repository with no stable tag and a 125k+ character history.
Related Issues
Closes #874