Add summary to a PR
Feature Request
Add the code coverage summary to a pull request without needing another Action. This could be optional.
Using Octokit this should be straightforward, if run from a PR the id of the PR can be obtained from the runner environment. An optional id parameter could allow posting to a PR when not run from a PR (e.g. manual run).
Expected Behaviour
Posts the coverage summary to a PR in a similar way to the marocchino/sticky-pull-request-comment action.
Additional Context
Linked To
You can use a third-party action for that, like so:
steps:
- name: Code Coverage Summary Report
uses: irongut/[email protected]
with:
filename: coverage.xml
badge: true
format: "markdown"
output: "both"
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
- name: Write to Job Summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
This would be useful for the cases if the threshold isn't being met. It would be nice to see the code coverage report on the PR despite the fact that the action will cause a failure.