fgrosse / go-coverage-report

A CLI tool and GitHub Action to post Go code coverage reports as comment to your pull requests.
BSD 3-Clause "New" or "Revised" License
59 stars 11 forks source link

Failure to retrieve artifacts #22

Closed rob94110 closed 5 months ago

rob94110 commented 5 months ago

The action is failing for me, apparently because there are no artifacts available in the target branch (not surprising because this is the first attempt to run it).

Download code coverage results from target branch
  ++ gh run list --status=success --branch=main --workflow=Build --event=push --json=databaseId --limit=1 -q '.[] | .databaseId'
  + LAST_SUCCESSFUL_RUN_ID=8953089596
  + '[' -z 8953089596 ']'
  + gh run download 8953089596 --name=code-coverage --dir=.github/outputs
  no valid artifacts found to download
  Error: Process completed with exit code 1.

Is there some set up/configuration step that I've missed?

Thanks,

Rob.

fgrosse commented 5 months ago

Hi Rob, so far, the action will always fail if there is no baseline coverage to compare to (like in your case). What you can do is to merge changes already that will collect and upload these on the target branch. Then in a second step you can enable the coverage report.

rob94110 commented 5 months ago

Thanks! Looks like it's working now.

Vishalks commented 5 months ago

@rob94110 I am getting the same error as you. What did you end up doing to solve it? cc: @fgrosse

rob94110 commented 5 months ago

Hi Vishal, I commented out the code_coverage part of the action and then merged the pull request. And then I uncommented it and did a second pull request.