Need help to understand how to use CodeCoverageSumarry for a badge
Hello,
First of all I'm sorry if I'm not in the right place to ask the question, I don't know where to do it more efficiently.
I'd like to know how I can make it so that when a merge request is accepted, a badge is automatically created with the information that codeCoverage generates.
Here's the link to the yml file I'm using for my project:
And I noticed (not on this repo, but on another with the same yml), that I do have the bot that generates this comment:
I'd really like the badge to automatically appear on the second line of my README.md file when the merge is accepted!
Thanks in advance :)
A possible solution for this is as follows:
- Create an action that runs when a PR is merged, in that you:
- Generate the new coverage data
- Modify your README using a script
- Commit and push the changes
This action currently doesn't support reading the coverage data in GitHub Actions (but I opened a PR to implement this: #233). This means you currently need to include the whole table from above in your README.
Some actions that can help you implement this:
- Generate a PR comment: thollander/actions-comment-pull-request@v2
- Add, commit and push changes: EndBug/add-and-commit@v9
Edit: I published a fork of this action that provides the coverage data for GitHub actions to use. You can see how I use it here: https://github.com/ricardoboss/STEP/blob/main/.github/workflows/report.yml
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days.