File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -54,13 +54,15 @@ jobs:
54
54
const fs = require('fs')
55
55
let data = fs.readFileSync('fulldiff.txt', { encoding: 'utf8' })
56
56
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
61
61
}
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) ...`
64
66
}
65
67
66
68
const projects = data.split('\n\n')
You can’t perform that action at this time.
0 commit comments