How to make Jenkins build unstable if there are failure test cases in serenity report? I am using Jenkins declarative pipeline and publishing serenity reports using HTML publish plugin.
See this post for a related question.
You could either write your own script with exit codes as the author originally started with, or you could experiment with a plugin like top answer suggests.
Writing your own script will give you more control, but implementation might take less time using a plugin.