Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Even though the code is short, I spent some time thinking about how would be best to implement it.
In short, we have the
pre
script of Cimon and thepost
script.The
pre
script can fail when we don't manage to reach the container's healthy state. If that happens, the CI will fail. For any other error thepre
script will continue, and it will fail on thepost
script`.In addition, the
post
script just outputs any log, includingstderr
the container had, so any possible error in the container (including the ones we had inpre
script) would surface inpost
and fail the CI.Having said that, I chosed to implement the
fail-on-error
flag in the following way:pre
script, if the container didn't reach healthy status, nothing will happen (not even a warning/error message)post
script, if any error happens, it will still return 0 (success), but will create a new job summary with the error message.I also wanted to reduce the amount of annotation messages and make them more concrete, that's why
pre
script shows nothing, and forpost
script, ifstderr
exists, it will print him, or else just genericcontainer failed...
message.You can see example for such run here: https://github.com/CycodeLabs/cimon-action/actions/runs/4712209939