PavanMudigonda / jacoco-reporter

GitHub Action to Publish JaCoCo Format Code Coverage XML and attach it to the Workflow Run as a Check Run. Also can enforce Coverage Quality Gate.
https://linkedin.com/in/PavanMudigonda
MIT License
69 stars 7 forks source link

GH Action failing when Covered Lines is 0 #8

Closed PavanMudigondaTR closed 2 years ago

PavanMudigondaTR commented 2 years ago

Describe the bug /usr/bin/pwsh -f /home/runner/work/_actions/PavanMudigonda/jacoco-reporter/v2.4/action.ps1 Module [GitHubActions] not found, INSTALLING... Running from [/home/runner/work/_actions/PavanMudigonda/jacoco-reporter/v2.4]

Creating test results space

/home/runner/work/Projet_devOPS/Projet_devOPS/_TMP

Publishing Report to GH Workflow

Covered Lines: 0 Missed Lines: 6 ParentContainsErrorRecordException: /home/runner/work/_actions/PavanMudigonda/jacoco-reporter/v2.4/action.ps1:130 Line | 130 | $coveragePercentage = [math]::Round(100 - (($missedLines … | ~~~~~~~~~~~~~ | Attempted to divide by zero.

Error: The process '/usr/bin/pwsh' failed with exit code 1

To Reproduce [Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error](https://github.com/ELCALVO/Projet_devOPS/runs/5990246809?check_suite_focus=true)

Expected behavior Error when covered lines is 0

Screenshots image

Additional context Add any other context about the problem here.

PavanMudigondaTR commented 2 years ago

Fixed @fixes #3