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

Update coverage comment #215

Merged
merged 1 commit into from
Jan 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/coverage-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ on:

jobs:
comment:
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event.workflow_run.event == 'pull_request' }}
name: 'Comment Code Coverage'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: 'Download artifacts'
uses: actions/github-script@v7.0.1
with:
Expand Down Expand Up @@ -44,6 +46,13 @@ jobs:
pr-number: ${{ env.pr_number }}
hide-branch-coverage: true
output-file: comment.html
- name: 'Prepend minimum coverage required'
run: |
echo -e "Minimum coverage required: <b>$(cat ./.github/minimum_coverage.txt)%</b>\n<br />\n$(cat comment.html)" > comment.html
- name: 'Prepand failure info'
if: ${{ github.event.workflow_run.conclusion != 'success' }}
run: |
echo -e "❌ <b>Minimum coverage check failed!</b>\n<br />\n$(cat comment.html)" > comment.html
- name: Post code coverage report
uses: marocchino/sticky-pull-request-comment@v2.8.0
with:
Expand Down
Loading