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

The action fails with undefined error #41

Open
charklewis opened this issue Apr 17, 2022 · 4 comments
Open

The action fails with undefined error #41

charklewis opened this issue Apr 17, 2022 · 4 comments

Comments

@charklewis
Copy link

charklewis commented Apr 17, 2022

I am trying to use this action however it always fails with:

TypeError: Cannot read property 'number' of undefined
[5](https://github.com/my-repo/runs/6051899683?check_suite_focus=true#step:7:5)
    at main$1 (/home/runner/work/_actions/romeovs/lcov-reporter-action/v0.2.11/dist/main.js:22921:2[6](https://github.com/my-repo/runs/6051899683?check_suite_focus=true#step:7:6))
6
Error: Cannot read property 'number' of undefined

Can you help me debug this?

@Birdi7
Copy link

Birdi7 commented Apr 22, 2022

I have the same issue just using the example with workflow_dispatch event trigger

- name: publish
   uses: romeovs/[email protected]
   with:
     lcov-file: ./coverage.lcov

@romeovs hello! do you have any time to check this?

@guilhermeagostinelli
Copy link

This error usually occurs when the workflow did not run on a "pull_request" event (e.g. ran on a "push").

You can inspect the github.event_name context property (https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#github-context) which contains the name of the event that triggered the workflow run to ensure that the code coverage report step will only run on PRs.

For example:

- uses: romeovs/[email protected]
  if: github.event_name == 'pull_request'

@hramrach
Copy link

How can I run the coverage report on a pull request, then?

The even I get when a pull request is updated is 'push'.

@hramrach
Copy link

Nevermind, that's determined by the selected action type in the workflow, both push and pull_request happen on updating a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants