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
63 stars 7 forks source link

Action doesn't work if `coverage_report_title` is not set #49

Closed josephearl closed 8 months ago

josephearl commented 8 months ago

Describe the bug

coverage_report_title is marked as optional, but the action fails if it is not set.

To Reproduce

Use the action with only the required parameters github_token and coverage_results_path.

The action fails with an error:

jacocoxml2md.ps1: /home/runner/work/_actions/PavanMudigonda/jacoco-reporter/v4.8/action.ps1:61
Line |
  61 |          & "$PSScriptRoot/jacoco-report/jacocoxml2md.ps1" -Verbose `
     |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Exception calling "AddParam" with "3" argument(s): "Value cannot be
     | null. (Parameter 'parameter')"

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

I believe the code here https://github.com/PavanMudigonda/jacoco-reporter/blob/2f45a2fe8f51b1254496217e035ddaf357505093/action.ps1#L56C5-L58C6 and in other places should be setting the title to $script:coverage_report_name and not $report_name.

Expected behavior

It works with only the required arguments.

PavanMudigondaTR commented 8 months ago

@josephearl thanks for reporting issue and making PR. Please try v4.9 and let me know !