-
-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Hi Daniel,
your tool is great, I'm loving it.
Your README inspired me to attach a GitHub Markdown report format to my PRs. The problem is, it doesn't work as your README says.
The GH CLI tool kept asking which branch it's on. I couldn't seem to get that to work. So I ended up using actions/github-script@v7 and github.rest.issues.createComment instead. But even for that approach, the PR comment body has a size limit of 65k which your Markdown report overran, so I had to truncate the content.
My final version looked something like this:
- name: Attach test coverage report to PR
uses: actions/github-script@v7
with:
script: |
const fs = require('fs')
var fileContents = fs.readFileSync('./reports/test_coverage/SummaryGithub.md').toString()
if (fileContents.length > 60000) {
const contentLines = fileContents.split(/\r?\n/)
const filteredLines = contentLines.filter(item => !item.startsWith("xxxxx"))
fileContents = filteredLines.join("\n")
}
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: fileContents
})Maybe you can update your README using my stuff and implement a truncation to avoid the size limit. But anyways, do whatever you want with my stuff. Just putting it out there for others who run into this issue.
Thanks again for providing this great tool.
Best wishes,
Marco