tools: fix max body length handler in create-release-proposal.sh

Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65455
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
This commit is contained in:
Antoine du Hamel committed 2026-09-07 11:53:55 +02:00
1 parent 06c7684b01
commit bc1f2718d5
1 file changed
+8 -3
+8 -3
View File
@@ -35,9 +35,14 @@ HEAD_SHA="$(git rev-parse HEAD^)"
TITLE="$(git log -1 --format=%s)"
TEMP_BODY="$(awk -v MAX_BODY_LENGTH="65536" \
"/^## ${RELEASE_DATE}/,/^<a id=/{ if (/^<a id=/) {exit;} if ((output_length += length(\$0)) > MAX_BODY_LENGTH) {exit 1;} print }" \
"doc/changelogs/CHANGELOG_V${RELEASE_LINE}.md" || echo "…")"
# GH rest API has an undocumented limit of 65536 char for the body, setting it
# to 65534 to account for the ellipsis and the final EOL.
TEMP_BODY="$(awk -v MAX_BODY_LENGTH="65534" \
"/^## ${RELEASE_DATE}/,/^<a id=/{
if (/^<a id=/) {exit;}
if ((output_length += length(\$0) + 1) > MAX_BODY_LENGTH) {exit 1;}
print
}" "doc/changelogs/CHANGELOG_V${RELEASE_LINE}.md" || echo "…")"
# Create the proposal branch
gh api \