ArtiomTr / jest-coverage-report-action

Track your code coverage in every pull request.
https://www.covbot.dev
MIT License
499 stars 143 forks source link

Error in step "Begin coverage annotations publication" #411

Closed matheuzsrlog closed 8 months ago

matheuzsrlog commented 8 months ago

Describe a bug

I have a problem with the step "Begin coverage annotations publication". It gives the error: Error: HttpError: Validation Failed: {"resource":"CheckRun","code":"invalid","field":"annotations"}.

I don't know if it could be a permission error. More is happening. (I decided to open the issue, after all I didn't change anything about permissions beforehand)

Below I left a print with the output of the action

Expected behavior

Details

Additional context

ArtiomTr commented 8 months ago

Hello @matheuzsrlog,

Are you running this action in public repo? It would be easier if I could check logs by myself. Also, if it is possible, could you please upload your report.json file here?

matheuzsrlog commented 8 months ago

No. My repository is not a public. :/ And, I don't have my artefact report.json, I think that is can to be also, my cache limit. image

matheuzsrlog commented 8 months ago

When checking my artifacts I have these related to coverage. But not report.json (this could also be the problem, I'm checking)

ArtiomTr commented 8 months ago

report.json is not stored as artifact, so that's not the problem.

Can you please run

npx jest --ci --json --coverage --testLocationInResults --outputFile=report.json

And post report.json file here or send an email to maintainers@covbot.dev?

matheuzsrlog commented 8 months ago

maintainers@covbot.dev

Do you receive my email? I am think that no sended.

ArtiomTr commented 8 months ago

Yes, thank you, will look into it

ArtiomTr commented 8 months ago

I have 0 clue why this is happening, tried some random fix, can you please check if it works? Just modify your action.yaml like so:

- uses: ArtiomTr/jest-coverage-report-action@Invalid-annotations-schema
matheuzsrlog commented 8 months ago

Thank you, I am go try it!

matheuzsrlog commented 8 months ago

Good job, it work out! Thank very much!

Was this the solution? https://github.com/ArtiomTr/jest-coverage-report-action/commit/303b93834588deb81728f967f8118a11cdf6134b

ArtiomTr commented 8 months ago

Yep, seems like annotations array cannot be empty. I will do another fix, so it covers both this issue and #383

ArtiomTr commented 8 months ago

Added other fix, but it should do almost the same as previous one. Could you please check, if v2.2.9 works for you?

matheuzsrlog commented 8 months ago

Added other fix, but it should do almost the same as previous one. Could you please check, if v2.2.9 works for you?

Only change for - uses: ArtiomTr/jest-coverage-report-action@v2.2.9, right?

ArtiomTr commented 8 months ago

Yep

matheuzsrlog commented 8 months ago

All right!! Thanks man, good one for you! image