yuzutech / annotations-action

GitHub action to create annotations from a JSON file
MIT License
31 stars 15 forks source link

Suggestion: Option to make failures fatal #20

Closed cmsj closed 3 years ago

cmsj commented 3 years ago

I have a workflow that I want to fail when failure annotations are found. At the moment I'm doing this with a step that counts the entries in the JSON file and if it's non-zero, it exits non-zero, but it would be much neater if I could tell annotations-action to fail in this scenario.

(to be clear, I would want the annotations posted to the PR, just for no further steps in the workflow to execute)

ggrossetie commented 3 years ago

It sounds like a good idea but I'm not sure... it might blur the line. The goal of this action is to annotate the code from a JSON files. I don't think this action should be responsible for failing the build.

In my opinion, what you are doing today (extra step that counts entries in the JSON file and if it's non-zero, it exits non-zero) is the right way to do it.

Having said that it would certainly be helpful so I'm a bit torn...

One thing that tells me it's a slippery slope is that the configuration could quickly get out of hand. For instance, we could decide to fail if there are more than 5 annotations with level warning or above...

Does it make sense? What do you think?

cmsj commented 3 years ago

I totally understand your points here. It would save me one step, but might cause you a lot of extra hassle (particularly if/when people ask for thresholds, etc). Thanks!