Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add summary to a PR #13

Open
irongut opened this issue Oct 16, 2021 · 2 comments
Open

Add summary to a PR #13

irongut opened this issue Oct 16, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request Summary An issue related to creating the code coverage summary.
Milestone

Comments

@irongut
Copy link
Owner

irongut commented Oct 16, 2021

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

@irongut irongut added the enhancement New feature or request label Oct 16, 2021
@irongut irongut self-assigned this Oct 16, 2021
@irongut irongut added the Summary An issue related to creating the code coverage summary. label Oct 16, 2021
@irongut irongut added this to To do in Enhancements via automation Oct 16, 2021
@irongut irongut moved this from To do to In Progress in Enhancements Oct 18, 2021
@irongut irongut moved this from In Progress to To do in Enhancements Oct 18, 2021
@irongut irongut added this to the vNext+1 milestone Oct 29, 2021
@irongut irongut modified the milestones: vNext+1, vNext Nov 25, 2021
@irongut irongut modified the milestones: vNext, vNext+1 Feb 27, 2022
@fredrikaverpil
Copy link

You can use a third-party action for that, like so:

  steps:
    - name: Code Coverage Summary Report
      uses: irongut/CodeCoverageSummary@v1.3.0
      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

@deanro
Copy link

deanro commented Jan 28, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Summary An issue related to creating the code coverage summary.
Projects
Development

No branches or pull requests

3 participants