This repository was archived by the owner on Mar 28, 2026. It is now read-only.
coverage-comment #2
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: coverage-comment | |
| on: | |
| workflow_run: | |
| workflows: [test] | |
| types: [completed] | |
| jobs: | |
| comment: | |
| if: > | |
| github.event.workflow_run.event == 'pull_request' && | |
| github.event.workflow_run.conclusion == 'success' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Download coverage artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: coverage | |
| run-id: ${{ github.event.workflow_run.id }} | |
| github-token: ${{ github.token }} | |
| - name: Post coverage comment | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| run: | | |
| PR=$(cat pr_number.txt) | |
| { | |
| echo "## Test Coverage" | |
| echo "" | |
| echo '```' | |
| cat coverage_summary.txt | |
| echo '```' | |
| } > comment_body.md | |
| gh pr comment "$PR" --body-file comment_body.md |