File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -54,13 +54,15 @@ jobs:
5454 const fs = require('fs')
5555 let data = fs.readFileSync('fulldiff.txt', { encoding: 'utf8' })
5656
57- function truncateIfNeeded(s , maxLength) {
58- let truncated = s .substring(0, maxLength)
59- if (s .length === truncated.length) {
60- return s
57+ function truncateIfNeeded(original , maxLength) {
58+ let truncated = original .substring(0, maxLength)
59+ if (original .length === truncated.length) {
60+ return original
6161 }
62- let lines_truncated = s.split('\n').length - truncated.split('\n').length
63- return `${truncated}\n\n... (truncated ${lines_truncated} lines) ...\n`
62+ // further, remove last line that might be truncated
63+ truncated = truncated.substring(0, truncated.lastIndexOf('\n'))
64+ let lines_truncated = original.split('\n').length - truncated.split('\n').length
65+ return `${truncated}\n\n... (truncated ${lines_truncated} lines) ...`
6466 }
6567
6668 const projects = data.split('\n\n')
You can’t perform that action at this time.
0 commit comments