mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
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:
1 file changed
+8
-3
@@ -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 \
|
||||
|
||||
Reference in new issue
Block a user