Skip to content

Commit b08a792

Browse files
fix(ci/spelling-check-bot): Argument list too long (#40494)
* fix(ci/spelling-check-bot): Argument list too long * Update .github/workflows/spelling-check-bot.yml Co-authored-by: Joshua Chen <[email protected]> --------- Co-authored-by: Joshua Chen <[email protected]>
1 parent 76bf753 commit b08a792

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/spelling-check-bot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,16 @@ jobs:
3939
if [ -n "${output}" ]; then
4040
output=$(node scripts/linkify-logs.js "${output}")
4141
output=$(echo "$output" | sed 's/^/- /')
42+
echo "Log size is ${#output} characters"
4243
echo "$output"
44+
45+
# Trim output to avoid GraphQL 'Body is too long (maximum is 65536 characters)' error
46+
maxLength=64000
47+
if [ ${#output} -gt ${maxLength} ]; then
48+
output=$(echo "$output" | head -c $maxLength)
49+
output+=$'\n...\n\n> [!WARNING]\n> The report is too long to be posted in full. Check the complete report in the [workflow logs](https://github.com/mdn/content/actions/runs/'"${GITHUB_RUN_ID}"$').'
50+
fi
51+
4352
echo "OUTPUT<<EOF" >> "$GITHUB_OUTPUT"
4453
echo "$output" >> "$GITHUB_OUTPUT"
4554
echo "EOF" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)