Skip to content

Commit d73afbf

Browse files
Fix check-links workflow: exclude malformed ToC URLs and truncate PR body
Co-Authored-By: David Konigsberg <davidakonigsberg@gmail.com>
1 parent c848e23 commit d73afbf

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/check-links.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
# Malformed ToC anchor links generated by the docs platform
3636
# These contain internal routing params (domain/host/auth/audience/version/path)
3737
# and are not real broken links — this is a fern-platform rendering bug
38+
"buildwithfern\\.com/_/buildwithfern\\.com/",
3839
"app\\.buildwithfern\\.com/buildwithfern\\.com/",
3940
4041
# Placeholder/example URLs
@@ -508,7 +509,7 @@ jobs:
508509
status=$(echo "$line" | sed -E 's/.*\[([0-9]+)\].*/\1/')
509510
510511
# Skip malformed ToC anchor links (fern-platform rendering bug)
511-
if echo "$url" | grep -qF 'app.buildwithfern.com/buildwithfern.com/'; then
512+
if echo "$url" | grep -qE 'buildwithfern\.com/_/buildwithfern\.com/|app\.buildwithfern\.com/buildwithfern\.com/'; then
512513
continue
513514
fi
514515
@@ -824,6 +825,15 @@ jobs:
824825
scaffoldContent += '\n---\n';
825826
scaffoldContent += `[View workflow run](https://github.com/${owner}/${repo}/actions/runs/${context.runId})\n`;
826827
828+
// Truncate PR body to stay under GitHub's 65536 character limit
829+
// The full content is still written to the scaffold file
830+
const MAX_PR_BODY_LENGTH = 60000; // leave headroom for safety
831+
let prBody = scaffoldContent;
832+
if (prBody.length > MAX_PR_BODY_LENGTH) {
833+
const truncationNote = `\n\n---\n⚠️ **Report truncated** — full list is in the scaffold file (\`${filePath}\`) on the branch.\n[View workflow run](https://github.com/${owner}/${repo}/actions/runs/${context.runId})\n`;
834+
prBody = prBody.substring(0, MAX_PR_BODY_LENGTH - truncationNote.length) + truncationNote;
835+
}
836+
827837
// Get the base branch ref
828838
const baseRef = await github.rest.git.getRef({
829839
owner,
@@ -961,7 +971,7 @@ jobs:
961971
title: 'Fix broken links (Devin)',
962972
head: branchName,
963973
base: baseBranch,
964-
body: scaffoldContent,
974+
body: prBody,
965975
draft: true,
966976
});
967977

0 commit comments

Comments
 (0)