Post coverage comment (from artifacts) #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Post coverage comment (from artifacts) | |
| on: | |
| workflow_run: | |
| workflows: | |
| - Test | |
| types: | |
| - completed | |
| permissions: | |
| contents: read | |
| actions: read | |
| issues: write | |
| pull-requests: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.workflow_run.id }} | |
| cancel-in-progress: true | |
| jobs: | |
| post-coverage: | |
| runs-on: ubuntu-latest | |
| if: > | |
| ${{ | |
| github.event.workflow_run.event == 'pull_request' && | |
| github.event.workflow_run.conclusion == 'success' | |
| }} | |
| steps: | |
| - name: Download Coverage Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: coverage-xml | |
| run-id: ${{ github.event.workflow_run.id }} | |
| github-token: ${{ github.token }} | |
| - name: Code Coverage Report | |
| uses: irongut/CodeCoverageSummary@v1.3.0 | |
| with: | |
| filename: coverage.xml | |
| badge: true | |
| fail_below_min: false | |
| format: markdown | |
| hide_branch_rate: false | |
| hide_complexity: true | |
| indicators: true | |
| output: both | |
| - name: Add Coverage PR Comment | |
| uses: marocchino/sticky-pull-request-comment@v2 | |
| with: | |
| recreate: true | |
| path: code-coverage-results.md | |
| number: ${{ github.event.workflow_run.pull_requests[0].number }} |