From 6d1b8a5fb12b5a0d1cbe5edc50a16e3be7edd5ce Mon Sep 17 00:00:00 2001 From: Matti Airas Date: Wed, 12 Aug 2026 11:15:17 +0300 Subject: [PATCH] ci: cap translation-status PR comment size GitHub rejects issue-comment bodies over 65536 characters with HTTP 422. A PR touching many English pages produces a with-diff report far beyond that (392 kB on a 10-page PR), which failed the check. When the report exceeds the limit, post the summary without diffs and point at the job summary, which still carries the full report. Co-Authored-By: Claude Fable 5 --- .github/workflows/translation-status.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/translation-status.yml b/.github/workflows/translation-status.yml index e21dd3b..b463071 100644 --- a/.github/workflows/translation-status.yml +++ b/.github/workflows/translation-status.yml @@ -58,6 +58,20 @@ jobs: # shellcheck disable=SC2086 uv run python scripts/translation_status.py \ --format markdown --diff --only-pages $pages > comment.md + + # GitHub rejects comment bodies over 65536 characters (HTTP 422). + # Wide PRs produce reports far beyond that; fall back to the + # summary without diffs and point at the job summary instead. + if [ "$(wc -c < comment.md)" -gt 60000 ]; then + # shellcheck disable=SC2086 + uv run python scripts/translation_status.py \ + --format markdown --only-pages $pages > comment.md + { + echo "" + echo "_Diffs omitted: the full report exceeds GitHub's comment size limit._" + echo "_See the workflow run's job summary for the complete report._" + } >> comment.md + fi printf '\n\n' >> comment.md existing=$(gh api "repos/${{ github.repository }}/issues/$PR/comments" \