EnricoMi / publish-unit-test-result-action

GitHub Action to publish unit test results on GitHub
Apache License 2.0
625 stars 183 forks source link

feat: Always publish json output and file if json_file is set #555

Closed ebbeknudsen closed 9 months ago

ebbeknudsen commented 10 months ago

Publish json output (and json_file) if json_file is set

As it is now, the json file is only published if check_run is set to true, which this PR changes. Now it will also publish even if check_run is false, as long as json_file is set.

An alternative would be to add a new setting called publish_check_run (default true for backwards compatibility), which would be used to decide if the check is published. Then if you want the json output without publishing the check run (in my case we can't use it, since it publishes to an incorrect workflow), you could set check_run to true, but override publish_check_run to false

Related issue: https://github.com/EnricoMi/publish-unit-test-result-action/issues/554

ebbeknudsen commented 10 months ago

@EnricoMi does this trigger running the automated tests GitHub Action? I had a problem running one of them locally, but it didn't seem to have anything to do with my changes.

ebbeknudsen commented 10 months ago

@EnricoMi i've added tests to verify the new feature

ebbeknudsen commented 10 months ago

@EnricoMi any news here? :)

EnricoMi commented 10 months ago

Looking at this a bit closer made me think that the publish_check method could need some refactoring, as it is currently doing two things: collect the (JSON) data to publish, and publish the check. Splitting that makes the calling publish method much cleaner. I have drafted something locally, but this tests then also require some rework. I am going to finish this in the coming weeks.

EnricoMi commented 9 months ago

Fixed in #568, contribution credit in 57248341ab40c707e2d76678040801738344be26. Thanks for raising this issue!