Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/mypy_primer_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ jobs:
fs.writeFileSync("diff.zip", Buffer.from(download.data));

- run: unzip diff.zip
# 30000 bytes is about 300 lines, posting comment fails if too long
- run: |
cat diff_*.txt | head -c 30000 | tee fulldiff.txt
cat diff_*.txt | tee fulldiff.txt

- name: Post comment
id: post-comment
Expand All @@ -49,7 +48,11 @@ jobs:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const fs = require('fs')
const data = fs.readFileSync('fulldiff.txt', { encoding: 'utf8' })
let data = fs.readFileSync('fulldiff.txt', { encoding: 'utf8' })
// posting comment fails if too long, so truncate
if (data.length > 30000) {
data = data.substring(0, 30000) + `\n\n... (truncated ${diff.length - 30000} chars) ...\n`
}

let body
if (data.trim()) {
Expand Down