Skip to content

Commit b972615

Browse files
authored
Merge branch 'main' into achievements-public-beta
2 parents 6430610 + 7d22386 commit b972615

File tree

1,640 files changed

+16032
-6700
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,640 files changed

+16032
-6700
lines changed

.github/actions-scripts/content-changes-table-comment.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ if (!APP_URL) {
2020
throw new Error(`APP_URL environment variable not set`)
2121
}
2222

23+
// the max size of the comment (in bytes)
24+
// the action we use to post the comment caps out at about 144kb
25+
// see docs-engineering#1849 for more info
26+
const MAX_COMMENT_SIZE = 125000
27+
2328
const PROD_URL = 'https://docs.github.com'
2429
const octokit = github.getOctokit(GITHUB_TOKEN)
2530

@@ -131,5 +136,25 @@ const lines = await Promise.all(
131136
return `| ${contentCell} | ${previewCell} | ${prodCell} | ${note} |`
132137
})
133138
)
134-
markdownTable += lines.join('\n')
139+
140+
// this section limits the size of the comment
141+
const cappedLines = []
142+
let underMax = true
143+
144+
lines.reduce((previous, current, index, array) => {
145+
if (underMax) {
146+
if (previous + current.length > MAX_COMMENT_SIZE) {
147+
underMax = false
148+
cappedLines.push('**Note** There are more changes in this PR than we can show.')
149+
return previous
150+
}
151+
152+
cappedLines.push(array[index])
153+
return previous + current.length
154+
}
155+
return previous
156+
}, markdownTable.length)
157+
158+
markdownTable += cappedLines.join('\n')
159+
135160
setOutput('changesTable', markdownTable)

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
14.7 KB
86.3 KB
85.4 KB
60.5 KB
60.2 KB
42.9 KB
92.9 KB

0 commit comments

Comments
 (0)